Skip to content

Instantly share code, notes, and snippets.

@kumarharsh
Created November 21, 2017 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumarharsh/e1948c6971f1c68577792ff914a00af7 to your computer and use it in GitHub Desktop.
Save kumarharsh/e1948c6971f1c68577792ff914a00af7 to your computer and use it in GitHub Desktop.
Reproduce bug in Git Log using this script (git-for-windows)
#!/usr/bin/env bash
set -x
rm -rf test-repo
rm -rf test-submodule
mkdir test-submodule
pushd test-submodule
git init
git config --local user.name tester1
git config --local user.email test@here.com
echo "a single line" > file.txt
git add file.txt
git commit -m "first commit"
popd
mkdir test-repo
pushd test-repo
git init
git config --local user.name tester1
git config --local user.email test@here.com
git branch -m master
echo "first line" > somefile.txt
git add somefile.txt
git commit -m "First line"
echo "another line" >> somefile.txt
git add somefile.txt
git commit -a -m "Second line"
echo "A line" > "[__Odd__].txt"
git add "[__Odd__].txt"
git commit -m "Adding odd file"
echo "third line" >> somefile.txt
git commit -a -m "Another bold statement."
echo "2nd line" >> "[__Odd__].txt"
echo "more" >> somefile.txt
git add "[__Odd__].txt" somefile.txt
git commit -m "changed both in master1"
git checkout -b new_branch
echo "2nd line" >> "[__Odd__].txt"
echo "more" >> somefile.txt
git add "[__Odd__].txt" somefile.txt
git commit -m "changed both in new_branch"
git checkout master
echo "2nd line" >> "[__Odd__].txt"
echo "more" >> somefile.txt
git add "[__Odd__].txt" somefile.txt
git commit -m "changed both in master"
git submodule add -- ../test-submodule module
git commit -m "Added submodule"
git log -- "[__Odd__].txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment