{"thread":{"id":"34423","subject":"[PATCH 0/4] Microfixes to mailmap","startedAt":"2013-07-12T21:38:51Z","lastAt":"2013-07-15T15:54:55Z","messageCount":14,"participants":["Junio C Hamano","Eric Sunshine","Stefan Beller"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"223222","messageId":"1373665135-32484-1-git-send-email-gitster@pobox.com","threadId":"34423","inReplyTo":null,"subject":"[PATCH 0/4] Microfixes to mailmap","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-12T21:38:51Z","receivedAt":"2013-07-12T21:38:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"There were a few bugs in mailmap parsing and matching code.\n\nJunio C Hamano (3):\n  mailmap: do not lose single-letter names\n  mailmap: do not downcase mailmap entries\n  mailmap: style fixes\n\nStefan Beller (1):\n  Add a testcase for checking case insensitivity of mailmap\n\n mailmap.c          | 37 +++++++++++++++++++------------------\n t/t4203-mailmap.sh | 33 +++++++++++++++++++++++++++++++++\n 2 files changed, 52 insertions(+), 18 deletions(-)\n\n-- \n1.8.3.2-941-gda9c3c8\n"},{"id":"223223","messageId":"1373665135-32484-2-git-send-email-gitster@pobox.com","threadId":"34423","inReplyTo":"1373665135-32484-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/4] mailmap: do not lose single-letter names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-12T21:38:52Z","receivedAt":"2013-07-12T21:38:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"In parse_name_and_email() function, there is this line:\n\n\t*name = (nstart < nend ? nstart : NULL);\n\nWhen the function is given a buffer \"A <A@example.org> <old@x.z>\",\nnstart scans from the beginning of the buffer, skipping whitespaces\n(there isn't any, so nstart points at the buffer), while nend starts\nfrom one byte before the first '<' and skips whitespaces backwards\nand stops at the first non-whitespace (i.e. it hits \"A\" at the\nbeginning of the buffer).  nstart == nend in this case for a\nsingle-letter name, and an off-by-one error makes it fail to pick up\nthe name, which makes the entry equivalent to\n\n\t<A@example.org> <old@x.z>\n\nwithout the name.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n mailmap.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex 2a7b366..418081e 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -122,7 +122,7 @@ static char *parse_name_and_email(char *buffer, char **name,\n \twhile (nend > nstart && isspace(*nend))\n \t\t--nend;\n \n-\t*name = (nstart < nend ? nstart : NULL);\n+\t*name = (nstart <= nend ? nstart : NULL);\n \t*email = left+1;\n \t*(nend+1) = '\\0';\n \t*right++ = '\\0';\n-- \n1.8.3.2-941-gda9c3c8\n"},{"id":"223226","messageId":"1373665135-32484-3-git-send-email-gitster@pobox.com","threadId":"34423","inReplyTo":"1373665135-32484-1-git-send-email-gitster@pobox.com","subject":"[PATCH 2/4] mailmap: do not downcase mailmap entries","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-12T21:38:53Z","receivedAt":"2013-07-12T21:38:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The email addresses in the records read from the .mailmap file are\ndowncased very early, and then used to match against e-mail\naddresses in the input.  Because we do use case insensitive version\nof string list to manage these entries, there is no need to do this,\nand worse yet, downcasing the rewritten/canonical e-mail read from\nthe .mailmap file loses information.\n\nStop doing that, and also make the string list used to keep multiple\nnames for an mailmap entry case insensitive (the code that uses the\nlist, lookup_prefix(), expects a case insensitive match).\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n mailmap.c | 20 ++++++++------------\n 1 file changed, 8 insertions(+), 12 deletions(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex 418081e..a7e92db 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -51,14 +51,6 @@ static void add_mapping(struct string_list *map,\n {\n \tstruct mailmap_entry *me;\n \tint index;\n-\tchar *p;\n-\n-\tif (old_email)\n-\t\tfor (p = old_email; *p; p++)\n-\t\t\t*p = tolower(*p);\n-\tif (new_email)\n-\t\tfor (p = new_email; *p; p++)\n-\t\t\t*p = tolower(*p);\n \n \tif (old_email == NULL) {\n \t\told_email = new_email;\n@@ -68,13 +60,17 @@ static void add_mapping(struct string_list *map,\n \tif ((index = string_list_find_insert_index(map, old_email, 1)) < 0) {\n \t\t/* mailmap entry exists, invert index value */\n \t\tindex = -1 - index;\n+\t\tme = (struct mailmap_entry *)map->items[index].util;\n \t} else {\n \t\t/* create mailmap entry */\n-\t\tstruct string_list_item *item = string_list_insert_at_index(map, index, old_email);\n-\t\titem->util = xcalloc(1, sizeof(struct mailmap_entry));\n-\t\t((struct mailmap_entry *)item->util)->namemap.strdup_strings = 1;\n+\t\tstruct string_list_item *item;\n+\n+\t\titem = string_list_insert_at_index(map, index, old_email);\n+\t\tme = xcalloc(1, sizeof(struct mailmap_entry));\n+\t\tme->namemap.strdup_strings = 1;\n+\t\tme->namemap.cmp = strcasecmp;\n+\t\titem->util = me;\n \t}\n-\tme = (struct mailmap_entry *)map->items[index].util;\n \n \tif (old_name == NULL) {\n \t\tdebug_mm(\"mailmap: adding (simple) entry for %s at index %d\\n\", old_email, index);\n-- \n1.8.3.2-941-gda9c3c8\n"},{"id":"223225","messageId":"1373665135-32484-4-git-send-email-gitster@pobox.com","threadId":"34423","inReplyTo":"1373665135-32484-1-git-send-email-gitster@pobox.com","subject":"[PATCH 3/4] mailmap: style fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-12T21:38:54Z","receivedAt":"2013-07-12T21:38:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wrap overlong lines and format the multi-line comments to match our\ncoding style.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n mailmap.c | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex a7e92db..5a3347d 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -37,7 +37,8 @@ static void free_mailmap_info(void *p, const char *s)\n static void free_mailmap_entry(void *p, const char *s)\n {\n \tstruct mailmap_entry *me = (struct mailmap_entry *)p;\n-\tdebug_mm(\"mailmap: removing entries for <%s>, with %d sub-entries\\n\", s, me->namemap.nr);\n+\tdebug_mm(\"mailmap: removing entries for <%s>, with %d sub-entries\\n\",\n+\t\t s, me->namemap.nr);\n \tdebug_mm(\"mailmap: - simple: '%s' <%s>\\n\", me->name, me->email);\n \tfree(me->name);\n \tfree(me->email);\n@@ -73,7 +74,8 @@ static void add_mapping(struct string_list *map,\n \t}\n \n \tif (old_name == NULL) {\n-\t\tdebug_mm(\"mailmap: adding (simple) entry for %s at index %d\\n\", old_email, index);\n+\t\tdebug_mm(\"mailmap: adding (simple) entry for %s at index %d\\n\",\n+\t\t\t old_email, index);\n \t\t/* Replace current name and new email for simple entry */\n \t\tif (new_name) {\n \t\t\tfree(me->name);\n@@ -85,7 +87,8 @@ static void add_mapping(struct string_list *map,\n \t\t}\n \t} else {\n \t\tstruct mailmap_info *mi = xcalloc(1, sizeof(struct mailmap_info));\n-\t\tdebug_mm(\"mailmap: adding (complex) entry for %s at index %d\\n\", old_email, index);\n+\t\tdebug_mm(\"mailmap: adding (complex) entry for %s at index %d\\n\",\n+\t\t\t old_email, index);\n \t\tif (new_name)\n \t\t\tmi->name = xstrdup(new_name);\n \t\tif (new_email)\n@@ -315,8 +318,10 @@ int map_user(struct string_list *map,\n \tif (item != NULL) {\n \t\tme = (struct mailmap_entry *)item->util;\n \t\tif (me->namemap.nr) {\n-\t\t\t/* The item has multiple items, so we'll look up on name too */\n-\t\t\t/* If the name is not found, we choose the simple entry      */\n+\t\t\t/*\n+\t\t\t * The item has multiple items, so we'll look up on name too.\n+\t\t\t * If the name is not found, we choose the simple entry.\n+\t\t\t */\n \t\t\tstruct string_list_item *subitem;\n \t\t\tsubitem = lookup_prefix(&me->namemap, *name, *namelen);\n \t\t\tif (subitem)\n-- \n1.8.3.2-941-gda9c3c8\n"},{"id":"223224","messageId":"1373665135-32484-5-git-send-email-gitster@pobox.com","threadId":"34423","inReplyTo":"1373665135-32484-1-git-send-email-gitster@pobox.com","subject":"[PATCH 4/4] add a testcase for checking case insensitivity of mailmap","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-12T21:38:55Z","receivedAt":"2013-07-12T21:38:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Stefan Beller <stefanbeller@googlemail.com>\n\nSigned-off-by: Stefan Beller <stefanbeller@googlemail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t4203-mailmap.sh | 33 +++++++++++++++++++++++++++++++++\n 1 file changed, 33 insertions(+)\n\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 842b754..07152e9 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -409,4 +409,37 @@ test_expect_success 'Blame output (complex mapping)' '\n \ttest_cmp expect actual.fuzz\n '\n \n+test_expect_success 'cleanup after mailmap.blob tests' '\n+\trm -f .mailmap\n+'\n+\n+cat >expect <<\\EOF\n+     2\tA <A@example.org>\n+     2\tOther Author <other@author.xx>\n+     2\tSanta Claus <santa.claus@northpole.xx>\n+     1\tA U Thor <author@example.com>\n+     1\tCTO <cto@company.xx>\n+     1\tSome Dude <some@dude.xx>\n+EOF\n+\n+test_expect_success 'Test case sensitivity of Names' '\n+\t# do a commit:\n+\techo \"asdf\" > test1\n+\tgit add test1\n+\tgit commit -a --author=\"A <A@example.org>\" -m \"add test1\"\n+\n+\t# commit with same name, but different email\n+\t# (different capitalization does the trick already,\n+\t# but here I am going to use a different mail)\n+\techo \"asdf\" > test2\n+\tgit add test2\n+\tgit commit -a --author=\"A <changed_email@example.org>\" -m \"add test2\"\n+\n+\t# Adding the line to the mailmap should make life easy, so we know\n+\t# it is the same person\n+\techo \"A <A@example.org> <changed_email@example.org>\" > .mailmap\n+\n+\tgit shortlog -sne HEAD >actual && test_cmp expect actual\n+'\n+\n test_done\n-- \n1.8.3.2-941-gda9c3c8\n"},{"id":"223227","messageId":"CAPig+cTE7ELo9xfNqOCq1p7xUgOUrr9WDiRkTbXgHPjqtzeEsw@mail.gmail.com","threadId":"34423","inReplyTo":"1373665135-32484-5-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 4/4] add a testcase for checking case insensitivity of mailmap","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-12T22:38:42Z","receivedAt":"2013-07-12T22:38:42Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jul 12, 2013 at 5:38 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> From: Stefan Beller <stefanbeller@googlemail.com>\n>\n> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  t/t4203-mailmap.sh | 33 +++++++++++++++++++++++++++++++++\n>  1 file changed, 33 insertions(+)\n>\n> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\n> index 842b754..07152e9 100755\n> --- a/t/t4203-mailmap.sh\n> +++ b/t/t4203-mailmap.sh\n> @@ -409,4 +409,37 @@ test_expect_success 'Blame output (complex mapping)' '\n>         test_cmp expect actual.fuzz\n>  '\n>\n> +test_expect_success 'cleanup after mailmap.blob tests' '\n> +       rm -f .mailmap\n> +'\n\nThis \"test\" was copied from earlier in the file, but the description\nwas not updated; it has nothing to do with mailmap.blob tests for\nwhich cleanup has already taken place.\n\nIt's also misleading since no .mailmap file exists at this point.\nInstead, configuration key mailmap.file is set to\ninternal_mailmap/.mailmap, so if you need to clean up anything, it\nwould be that.\n\n(You're also recreating .mailmap from scratch directly in your test\nvia \"echo foo >.mailmap\", so this \"test\" doesn't really add anything.)\n\n> +cat >expect <<\\EOF\n> +     2 A <A@example.org>\n> +     2 Other Author <other@author.xx>\n> +     2 Santa Claus <santa.claus@northpole.xx>\n> +     1 A U Thor <author@example.com>\n> +     1 CTO <cto@company.xx>\n> +     1 Some Dude <some@dude.xx>\n> +EOF\n> +\n> +test_expect_success 'Test case sensitivity of Names' '\n\ns/Names/names/\n\nAlso, most of the test descriptions in this script start with\nlowercase, so s/Test/test/ would be appropriate.\n\n> +       # do a commit:\n> +       echo \"asdf\" > test1\n\nGit practice normally avoids whitespace after the redirection\noperator. This particular test script, has a mix of \">foo\" and \">\nfoo\", but we may want to avoid adding more of the latter form.\n\n> +       git add test1\n> +       git commit -a --author=\"A <A@example.org>\" -m \"add test1\"\n> +\n> +       # commit with same name, but different email\n> +       # (different capitalization does the trick already,\n> +       # but here I am going to use a different mail)\n\nWithout context of the mailing list discussion, the reader does not\nknow what \"trick\" is or precisely how this may have failed in the\npast. It's also not clear why the test is being performed with a\ndifferent email address entirely rather than one which differs only by\ncase (which is what the test description talks about).\n\n> +       echo \"asdf\" > test2\n\nWhitespace after redirection.\n\n> +       git add test2\n> +       git commit -a --author=\"A <changed_email@example.org>\" -m \"add test2\"\n> +\n> +       # Adding the line to the mailmap should make life easy, so we know\n> +       # it is the same person\n\nThe comment can probably be dropped, as the new .mailmap entry is\nself-explanatory.\n\n> +       echo \"A <A@example.org> <changed_email@example.org>\" > .mailmap\n\nWhitespace after redirection.\n\n> +\n> +       git shortlog -sne HEAD >actual && test_cmp expect actual\n\nFor consistency with more other tests, perhaps break the line apart:\n\n  git shortlog -sne HEAD >actual &&\n  test_cmp expect actual\n\n> +'\n> +\n>  test_done\n> --\n> 1.8.3.2-941-gda9c3c8\n"},{"id":"223229","messageId":"CAPig+cS-AGTa7DUZKsy2cq6Pd0LFV_4BBFsCVd+CGZ+xWpVh5w@mail.gmail.com","threadId":"34423","inReplyTo":"1373665135-32484-5-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 4/4] add a testcase for checking case insensitivity of mailmap","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-12T22:51:56Z","receivedAt":"2013-07-12T22:51:56Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jul 12, 2013 at 5:38 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> From: Stefan Beller <stefanbeller@googlemail.com>\n>\n> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  t/t4203-mailmap.sh | 33 +++++++++++++++++++++++++++++++++\n>  1 file changed, 33 insertions(+)\n>\n> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\n> index 842b754..07152e9 100755\n> --- a/t/t4203-mailmap.sh\n> +++ b/t/t4203-mailmap.sh\n> +test_expect_success 'Test case sensitivity of Names' '\n> +       # do a commit:\n> +       echo \"asdf\" > test1\n> +       git add test1\n> +       git commit -a --author=\"A <A@example.org>\" -m \"add test1\"\n> +\n> +       # commit with same name, but different email\n> +       # (different capitalization does the trick already,\n> +       # but here I am going to use a different mail)\n> +       echo \"asdf\" > test2\n> +       git add test2\n> +       git commit -a --author=\"A <changed_email@example.org>\" -m \"add test2\"\n> +\n> +       # Adding the line to the mailmap should make life easy, so we know\n> +       # it is the same person\n> +       echo \"A <A@example.org> <changed_email@example.org>\" > .mailmap\n> +\n> +       git shortlog -sne HEAD >actual && test_cmp expect actual\n> +'\n\nI forgot to mention that the &&-chain is broken (missing) in the\nentire test (except for the last line).\n"},{"id":"223242","messageId":"1373700020-30436-1-git-send-email-stefanbeller@googlemail.com","threadId":"34423","inReplyTo":"1373665135-32484-2-git-send-email-gitster@pobox.com","subject":"[PATCH] mailmap: Testing the single letter name case.","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-13T07:20:20Z","receivedAt":"2013-07-13T07:20:20Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This is a regression test for a66e77eab70a08938fdc2227b7ada0f0465c6991\n\nSigned-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n t/t4203-mailmap.sh | 41 +++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 41 insertions(+)\n\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 842b754..9ec87a2 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -409,4 +409,45 @@ test_expect_success 'Blame output (complex mapping)' '\n \ttest_cmp expect actual.fuzz\n '\n \n+cat >expect <<\\EOF\n+A <ShortName@company.xy> (2):\n+      eighth\n+      nineth\n+\n+A U Thor <author@example.com> (1):\n+      initial\n+\n+CTO <cto@company.xx> (1):\n+      seventh\n+\n+Other Author <other@author.xx> (2):\n+      third\n+      fourth\n+\n+Santa Claus <santa.claus@northpole.xx> (2):\n+      fifth\n+      sixth\n+\n+Some Dude <some@dude.xx> (1):\n+      second\n+\n+EOF\n+\n+# Regression test\n+# Using a single letter name to check for off-by-one errors in parse_name_and_email\n+test_expect_success 'check mapping for short names' '\n+\techo one >two &&\n+\tgit add two &&\n+\tgit commit --author \"A <shortname@company.xx>\" -m \"eighth\" &&\n+\n+\techo two >> two &&\n+\tgit add two &&\n+\tgit commit --author \"A <ShortName@company.xy>\" -m \"nineth\" &&\n+\n+\techo \"A <ShortName@company.xy> <shortname@company.xx>\" >> .mailmap &&\n+\tgit shortlog HEAD -e >actual\n+\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.8.3.2.776.gfcf213d\n"},{"id":"223247","messageId":"7v8v1aicn5.fsf@alter.siamese.dyndns.org","threadId":"34423","inReplyTo":"1373700020-30436-1-git-send-email-stefanbeller@googlemail.com","subject":"Re: [PATCH] mailmap: Testing the single letter name case.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-13T17:38:06Z","receivedAt":"2013-07-13T17:38:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <stefanbeller@googlemail.com> writes:\n\n> This is a regression test for a66e77eab70a08938fdc2227b7ada0f0465c6991\n\nSorry, I do not quite get this.\n\nIf you apply the patch on top of the said commit before that commit, the\nnew test does not pass.\n\nBut if you apply the patch on top of the said commit, the new test\nstill does not pass.\n\nSo I am having hard time guessing what you meant by \"regression\ntest\".  It is not \"a66e77 broke something that ought to work, and\nthis shows the breakage\".  It is not \"a66e77 fixed something and\nthis shows the previous breakage that got fixed.\"\n\nIt may be because the test is depending on ShortName not to be\ndowncased incorrectly, which was to be fixed by a later commit.  But\nafter applying this on top of jc/mailmap-case-insensitivity topic,\nthe test does not pass (and reverting a66e77 does not seem to affect\nthe result, either).\n"},{"id":"223248","messageId":"51E198FC.5080005@googlemail.com","threadId":"34423","inReplyTo":"7v8v1aicn5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mailmap: Testing the single letter name case.","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-13T18:14:20Z","receivedAt":"2013-07-13T18:14:20Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 07/13/2013 07:38 PM, Junio C Hamano wrote:\n> Stefan Beller <stefanbeller@googlemail.com> writes:\n> \n>> This is a regression test for a66e77eab70a08938fdc2227b7ada0f0465c6991\n> \n> Sorry, I do not quite get this.\n> \n> If you apply the patch on top of the said commit before that commit, the\n> new test does not pass.\n> \n> But if you apply the patch on top of the said commit, the new test\n> still does not pass.\n> \n> So I am having hard time guessing what you meant by \"regression\n> test\".  It is not \"a66e77 broke something that ought to work, and\n> this shows the breakage\".  It is not \"a66e77 fixed something and\n> this shows the previous breakage that got fixed.\"\n> \n> It may be because the test is depending on ShortName not to be\n> downcased incorrectly, which was to be fixed by a later commit.  But\n> after applying this on top of jc/mailmap-case-insensitivity topic,\n> the test does not pass (and reverting a66e77 does not seem to affect\n> the result, either).\n> \n\nI am sorry for the bad wording, sorry for wasting your time.\n\nThis patch was meant to replace 134d1ac9be2ce97c60a7e9187c32980681811cb5\n(current test, latest commit on mailmap-case-insensitivity)\n\nIndeed the patch tests for both bugs unintentionally.\nSo both the one letter name is being used and the email\ncase sensitivity is checked.\nSo maybe I should redo it again and make 2 explicit test cases\nfor each of the fixes?\n\nStefan\n"},{"id":"223254","messageId":"7vk3kugqkl.fsf@alter.siamese.dyndns.org","threadId":"34423","inReplyTo":"51E198FC.5080005@googlemail.com","subject":"Re: [PATCH] mailmap: Testing the single letter name case.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-13T20:20:10Z","receivedAt":"2013-07-13T20:20:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <stefanbeller@googlemail.com> writes:\n\n> Indeed the patch tests for both bugs unintentionally.\n\nI was puzzled because I do not think that is what is happening with\nthe posted patch.\n\nIf I drop the tip one from jc/mailmap-case-insensitivity and apply\nthis patch instead, the test passes (which is good).\n\n\tgit checkout 1ab5d42\n        git am <sb.mbox\n        make && cd t && sh t4203-mailmap.sh\n\nOf course, if I revert 543f991 (i.e. do not downcase fix), the test\nin this patch fails as expected.\n\n\tgit checkout 1ab5d42\n        git am <sb.mbox\n\tgit show 543f991 | git apply -R\n        make && cd t && sh t4203-mailmap.sh ;# should fail and does\n\nBut if I only revert a66e77e (i.e. off-by-one fix) while still\nkeeping the downcase fix, the test in this patch should fail---but\nit doesn't seem to.\n\n\tgit checkout 1ab5d42\n        git am <sb.mbox\n\tgit show a66e77e | git apply -R -3\n        make && cd t && sh t4203-mailmap.sh ;# should fail but doesn't\n\nThe off-by-one fix seems to be correct from code inspection, but the\nnew test does not seem to demonstrate a case where the code before\nthe fix misbehaves.\n"},{"id":"223261","messageId":"CAPig+cRQ5yVYjY==5P+kKJycdHDp9avzcxHvZj34GJ3oBAcesg@mail.gmail.com","threadId":"34423","inReplyTo":"1373700020-30436-1-git-send-email-stefanbeller@googlemail.com","subject":"Re: [PATCH] mailmap: Testing the single letter name case.","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-14T02:38:27Z","receivedAt":"2013-07-14T02:38:27Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Jul 13, 2013 at 3:20 AM, Stefan Beller\n<stefanbeller@googlemail.com> wrote:\n> This is a regression test for a66e77eab70a08938fdc2227b7ada0f0465c6991\n>\n> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>\n> ---\n>  t/t4203-mailmap.sh | 41 +++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 41 insertions(+)\n>\n> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\n> index 842b754..9ec87a2 100755\n> --- a/t/t4203-mailmap.sh\n> +++ b/t/t4203-mailmap.sh\n> @@ -409,4 +409,45 @@ test_expect_success 'Blame output (complex mapping)' '\n>         test_cmp expect actual.fuzz\n>  '\n>\n> +# Regression test\n> +# Using a single letter name to check for off-by-one errors in parse_name_and_email\n> +test_expect_success 'check mapping for short names' '\n> +       echo one >two &&\n> +       git add two &&\n> +       git commit --author \"A <shortname@company.xx>\" -m \"eighth\" &&\n> +\n> +       echo two >> two &&\n\ns/>> />>/\n\n> +       git add two &&\n> +       git commit --author \"A <ShortName@company.xy>\" -m \"nineth\" &&\n> +\n> +       echo \"A <ShortName@company.xy> <shortname@company.xx>\" >> .mailmap &&\n\ns/>> />>/\n\n> +       git shortlog HEAD -e >actual\n\nBroken &&-chain: s/actual/actual &&/\n\n> +\n> +       test_cmp expect actual\n> +'\n> +\n>  test_done\n> --\n> 1.8.3.2.776.gfcf213d\n>\n"},{"id":"223364","messageId":"CAPig+cR8zhcZ9_Gjq9mv0kPMe7F=szeSANG1b3J3gitoWCZaxA@mail.gmail.com","threadId":"34423","inReplyTo":"7vk3kugqkl.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] mailmap: Testing the single letter name case.","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T02:31:50Z","receivedAt":"2013-07-15T02:31:50Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Jul 13, 2013 at 4:20 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stefan Beller <stefanbeller@googlemail.com> writes:\n>\n>> Indeed the patch tests for both bugs unintentionally.\n>\n> I was puzzled because I do not think that is what is happening with\n> the posted patch.\n>\n> The off-by-one fix seems to be correct from code inspection, but the\n> new test does not seem to demonstrate a case where the code before\n> the fix misbehaves.\n\nI've written tests which check for the two bugs which Junio's patches\nfix. I'll be sending them along with a re-roll of Junio's series along\nwith a few other fixes to mailmap's debug mode.\n"},{"id":"223445","messageId":"7vzjtnbyy8.fsf@alter.siamese.dyndns.org","threadId":"34423","inReplyTo":"CAPig+cR8zhcZ9_Gjq9mv0kPMe7F=szeSANG1b3J3gitoWCZaxA@mail.gmail.com","subject":"Re: [PATCH] mailmap: Testing the single letter name case.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-15T15:54:55Z","receivedAt":"2013-07-15T15:54:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}