Subject: Bug in .mailmap handling?

From: Stefan Beller <[email-masked]>
Date: Fri, 12 Jul 2013 18:07:21 +0200

Hello,

you may have noticed I am currently trying to bring the 
mailmap file of git itself up to date. I noticed
some behavior, which I did not expect. Have a look yourself:

---
	# prepare test environment:
	mkdir testmailmap
	cd testmailmap/
	git init

	# do a commit:
	echo "asdf" > test1 
	git add test1
	git commit -a --author="A <[email-masked]>" -m "add test1"

	# commit with same name, but different email 
	# (different capitalization does the trick already, 
	# but here I am going to use a different mail)
	echo "asdf" > test2
	git add test2
	git commit -a --author="A <[email-masked]>" -m "add test2"

	# how do we know it's the same person?
	git shortlog
	A (2):
		  add test1
		  add test2

	# reports as expected:
	git shortlog -sne
		  1  A <[email-masked]>
		  1  A <[email-masked]>
		  
	# Adding the line to the mailmap should make life easy, so we know
	# it's the same person
	echo "A <[email-masked]> <[email-masked]>" > .mailmap

	# Come on, I just wanted to have it reported as one person!
	git shortlog -sne
		 1  A <[email-masked]>
		 1  A <[email-masked]>
		 
	# So let's try another line in the mailmap file, (small 'a')
	echo "A <[email-masked]> <[email-masked]>" > .mailmap

	# We're not there yet?
	git shortlog -sne
		 1  A <[email-masked]>
		 1  A <[email-masked]>

	# Now let's write it rather explicit: 
	# (essentially just write 2 lines into the mailmap file)
	cat << EOF > .mailmap
	A <[email-masked]> <[email-masked]>
	A <[email-masked]> <[email-masked]>
	EOF
		 
	# works as expected now
	git shortlog -sne
		 2  A <[email-masked]>

	# works as expected now as well
	git shortlog      
	A (2):
		  add test1
		  add test2