{"thread":{"id":"34437","subject":"[PATCH v2 0/9] mailmap fixes","startedAt":"2013-07-15T06:54:04Z","lastAt":"2013-07-15T15:22:48Z","messageCount":12,"participants":["Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":9},"messages":[{"id":"223385","messageId":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":null,"subject":"[PATCH v2 0/9] mailmap fixes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:04Z","receivedAt":"2013-07-15T06:54:04Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"This is a re-roll of jc/mailmap-case-insensitivity [1] in 'pu', which\nfixes an off-by-one parsing bug and a case-losing bug in mailmap.\n\nChanges since v1:\n\n* Replace v1 [4/4] with new [1/9] and [3/9] which explicitly demonstrate\n  each bug being fixed.\n\n* Fix several crashes and issues in mailmap debug code (new patches\n  [5/9] through [8/9].\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/230258/\n\nEric Sunshine (6):\n  t4203: demonstrate loss of single-character name in mailmap entry\n  t4203: demonstrate loss of uppercase characters in canonical email\n  mailmap: debug: fix out-of-order fprintf() arguments\n  mailmap: debug: fix malformed fprintf() format directive\n  mailmap: debug: eliminate -Wformat field precision type warning\n  mailmap: debug: avoid passing NULL to fprintf() '%s' directive\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\n mailmap.c          | 67 +++++++++++++++++++++++++++++++-----------------------\n t/t4203-mailmap.sh | 18 +++++++++++++++\n 2 files changed, 57 insertions(+), 28 deletions(-)\n\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223386","messageId":"1373871253-96480-2-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 1/9] t4203: demonstrate loss of single-character name in mailmap entry","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:05Z","receivedAt":"2013-07-15T06:54:05Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"A bug in mailmap.c:parse_name_and_email() causes it to overlook the\nsingle-character name in \"A <user@host>\" and parse it only as\n\"<user@host>\". Demonstrate this problem.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n t/t4203-mailmap.sh | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 842b754..27f8f86 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -247,6 +247,15 @@ test_expect_success 'cleanup after mailmap.blob tests' '\n \trm -f .mailmap\n '\n \n+test_expect_failure 'single-character name' '\n+\techo \"     1\tA <author@example.com>\" >expect &&\n+\techo \"     1\tnick1 <bugs@company.xx>\" >>expect &&\n+\techo \"A <author@example.com>\" >.mailmap &&\n+\ttest_when_finished \"rm .mailmap\" &&\n+\tgit shortlog -es HEAD >actual &&\n+\ttest_cmp expect actual\n+'\n+\n # Extended mailmap configurations should give us the following output for shortlog\n cat >expect <<\\EOF\n A U Thor <author@example.com> (1):\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223387","messageId":"1373871253-96480-3-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 2/9] mailmap: do not lose single-letter names","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:06Z","receivedAt":"2013-07-15T06:54:06Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nIn 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>\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c          | 2 +-\n t/t4203-mailmap.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\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';\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 27f8f86..8583724 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -247,7 +247,7 @@ test_expect_success 'cleanup after mailmap.blob tests' '\n \trm -f .mailmap\n '\n \n-test_expect_failure 'single-character name' '\n+test_expect_success 'single-character name' '\n \techo \"     1\tA <author@example.com>\" >expect &&\n \techo \"     1\tnick1 <bugs@company.xx>\" >>expect &&\n \techo \"A <author@example.com>\" >.mailmap &&\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223388","messageId":"1373871253-96480-4-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 3/9] t4203: demonstrate loss of uppercase characters in canonical email","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:07Z","receivedAt":"2013-07-15T06:54:07Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"The email addresses read from .mailmap are downcased before being\ninserted into the mailmap data structure, which undesirably loses\ninformation.  It is impossible, for instance, to map <first.last@host>\nto <First.Last@host>. Demonstrate this problem.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n t/t4203-mailmap.sh | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 8583724..ffe6a11 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -256,6 +256,15 @@ test_expect_success 'single-character name' '\n \ttest_cmp expect actual\n '\n \n+test_expect_failure 'preserve canonical email case' '\n+\techo \"     1\tA U Thor <AUTHOR@example.com>\" >expect &&\n+\techo \"     1\tnick1 <bugs@company.xx>\" >>expect &&\n+\techo \"<AUTHOR@example.com> <author@example.com>\" >.mailmap &&\n+\ttest_when_finished \"rm .mailmap\" &&\n+\tgit shortlog -es HEAD >actual &&\n+\ttest_cmp expect actual\n+'\n+\n # Extended mailmap configurations should give us the following output for shortlog\n cat >expect <<\\EOF\n A U Thor <author@example.com> (1):\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223389","messageId":"1373871253-96480-5-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 4/9] mailmap: do not downcase mailmap entries","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:08Z","receivedAt":"2013-07-15T06:54:08Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nThe 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>\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c          | 20 ++++++++------------\n t/t4203-mailmap.sh |  2 +-\n 2 files changed, 9 insertions(+), 13 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);\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex ffe6a11..c32df80 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -256,7 +256,7 @@ test_expect_success 'single-character name' '\n \ttest_cmp expect actual\n '\n \n-test_expect_failure 'preserve canonical email case' '\n+test_expect_success 'preserve canonical email case' '\n \techo \"     1\tA U Thor <AUTHOR@example.com>\" >expect &&\n \techo \"     1\tnick1 <bugs@company.xx>\" >>expect &&\n \techo \"<AUTHOR@example.com> <author@example.com>\" >.mailmap &&\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223391","messageId":"1373871253-96480-6-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 5/9] mailmap: debug: fix out-of-order fprintf() arguments","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:09Z","receivedAt":"2013-07-15T06:54:09Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"Resolve segmentation fault due to arguments passed in wrong order.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex a7e92db..0516354 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -309,7 +309,7 @@ int map_user(struct string_list *map,\n \tstruct mailmap_entry *me;\n \n \tdebug_mm(\"map_user: map '%.*s' <%.*s>\\n\",\n-\t\t *name, *namelen, *emaillen, *email);\n+\t\t *namelen, *name, *emaillen, *email);\n \n \titem = lookup_prefix(map, *email, *emaillen);\n \tif (item != NULL) {\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223392","messageId":"1373871253-96480-7-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 6/9] mailmap: debug: fix malformed fprintf() format directive","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:10Z","receivedAt":"2013-07-15T06:54:10Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"Resolve segmentation fault due to size_t variable being consumed\nby '%s'.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex 0516354..62d998a 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -337,7 +337,7 @@ int map_user(struct string_list *map,\n \t\t\t\t*name = mi->name;\n \t\t\t\t*namelen = strlen(*name);\n \t\t}\n-\t\tdebug_mm(\"map_user:  to '%.*s' <.*%s>\\n\", *namelen, *name,\n+\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\", *namelen, *name,\n \t\t\t\t *emaillen, *email);\n \t\treturn 1;\n \t}\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223390","messageId":"1373871253-96480-8-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 7/9] mailmap: debug: eliminate -Wformat field precision type warning","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:11Z","receivedAt":"2013-07-15T06:54:11Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"The compiler complains that '*' in fprintf() format directive \"%.*s\"\nshould have type int, but we pass size_t. Fix this.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex 62d998a..4cc6e81 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -309,7 +309,7 @@ int map_user(struct string_list *map,\n \tstruct mailmap_entry *me;\n \n \tdebug_mm(\"map_user: map '%.*s' <%.*s>\\n\",\n-\t\t *namelen, *name, *emaillen, *email);\n+\t\t (int)*namelen, *name, (int)*emaillen, *email);\n \n \titem = lookup_prefix(map, *email, *emaillen);\n \tif (item != NULL) {\n@@ -337,8 +337,8 @@ int map_user(struct string_list *map,\n \t\t\t\t*name = mi->name;\n \t\t\t\t*namelen = strlen(*name);\n \t\t}\n-\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\", *namelen, *name,\n-\t\t\t\t *emaillen, *email);\n+\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\", (int)*namelen, *name,\n+\t\t\t\t (int)*emaillen, *email);\n \t\treturn 1;\n \t}\n \tdebug_mm(\"map_user:  --\\n\");\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223394","messageId":"1373871253-96480-9-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 8/9] mailmap: debug: avoid passing NULL to fprintf() '%s' directive","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:12Z","receivedAt":"2013-07-15T06:54:12Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"POSIX does not state the behavior of format directive '%s' when passed a\nNULL pointer. Some implementations interpolate literal \"(null)\"; others\nmay crash. Callers of debug_mm() often pass NULL as indication of either\na missing name or email address.  Instead, let's always supply a proper\nstring pointer, and make it a bit more descriptive: \"(none)\"\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c | 15 +++++++++------\n 1 file changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex 4cc6e81..928e6e5 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -5,8 +5,10 @@\n #define DEBUG_MAILMAP 0\n #if DEBUG_MAILMAP\n #define debug_mm(...) fprintf(stderr, __VA_ARGS__)\n+#define debug_str(X) ((X) ? (X) : \"(none)\")\n #else\n static inline void debug_mm(const char *format, ...) {}\n+static inline const char *debug_str(const char *s) { return s; }\n #endif\n \n const char *git_mailmap_file;\n@@ -29,7 +31,7 @@ struct mailmap_entry {\n static void free_mailmap_info(void *p, const char *s)\n {\n \tstruct mailmap_info *mi = (struct mailmap_info *)p;\n-\tdebug_mm(\"mailmap: -- complex: '%s' -> '%s' <%s>\\n\", s, mi->name, mi->email);\n+\tdebug_mm(\"mailmap: -- complex: '%s' -> '%s' <%s>\\n\", s, debug_str(mi->name), debug_str(mi->email));\n \tfree(mi->name);\n \tfree(mi->email);\n }\n@@ -38,7 +40,8 @@ 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: - simple: '%s' <%s>\\n\", me->name, me->email);\n+\tdebug_mm(\"mailmap: - simple: '%s' <%s>\\n\", debug_str(me->name), debug_str(me->email));\n+\n \tfree(me->name);\n \tfree(me->email);\n \n@@ -94,7 +97,7 @@ static void add_mapping(struct string_list *map,\n \t}\n \n \tdebug_mm(\"mailmap:  '%s' <%s> -> '%s' <%s>\\n\",\n-\t\t old_name, old_email, new_name, new_email);\n+\t\t debug_str(old_name), old_email, debug_str(new_name), debug_str(new_email));\n }\n \n static char *parse_name_and_email(char *buffer, char **name,\n@@ -309,7 +312,7 @@ int map_user(struct string_list *map,\n \tstruct mailmap_entry *me;\n \n \tdebug_mm(\"map_user: map '%.*s' <%.*s>\\n\",\n-\t\t (int)*namelen, *name, (int)*emaillen, *email);\n+\t\t (int)*namelen, debug_str(*name), (int)*emaillen, debug_str(*email));\n \n \titem = lookup_prefix(map, *email, *emaillen);\n \tif (item != NULL) {\n@@ -337,8 +340,8 @@ int map_user(struct string_list *map,\n \t\t\t\t*name = mi->name;\n \t\t\t\t*namelen = strlen(*name);\n \t\t}\n-\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\", (int)*namelen, *name,\n-\t\t\t\t (int)*emaillen, *email);\n+\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\", (int)*namelen, debug_str(*name),\n+\t\t\t\t (int)*emaillen, debug_str(*email));\n \t\treturn 1;\n \t}\n \tdebug_mm(\"map_user:  --\\n\");\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223393","messageId":"1373871253-96480-10-git-send-email-sunshine@sunshineco.com","threadId":"34437","inReplyTo":"1373871253-96480-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 9/9] mailmap: style fixes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T06:54:13Z","receivedAt":"2013-07-15T06:54:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nWrap overlong lines and format the multi-line comments to match our\ncoding style.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n mailmap.c | 42 +++++++++++++++++++++++++++---------------\n 1 file changed, 27 insertions(+), 15 deletions(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex 928e6e5..44614fc 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -31,7 +31,8 @@ struct mailmap_entry {\n static void free_mailmap_info(void *p, const char *s)\n {\n \tstruct mailmap_info *mi = (struct mailmap_info *)p;\n-\tdebug_mm(\"mailmap: -- complex: '%s' -> '%s' <%s>\\n\", s, debug_str(mi->name), debug_str(mi->email));\n+\tdebug_mm(\"mailmap: -- complex: '%s' -> '%s' <%s>\\n\",\n+\t\t s, debug_str(mi->name), debug_str(mi->email));\n \tfree(mi->name);\n \tfree(mi->email);\n }\n@@ -39,8 +40,10 @@ 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: - simple: '%s' <%s>\\n\", debug_str(me->name), debug_str(me->email));\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\",\n+\t\t debug_str(me->name), debug_str(me->email));\n \n \tfree(me->name);\n \tfree(me->email);\n@@ -50,7 +53,8 @@ static void free_mailmap_entry(void *p, const char *s)\n }\n \n static void add_mapping(struct string_list *map,\n-\t\t\tchar *new_name, char *new_email, char *old_name, char *old_email)\n+\t\t\tchar *new_name, char *new_email,\n+\t\t\tchar *old_name, char *old_email)\n {\n \tstruct mailmap_entry *me;\n \tint index;\n@@ -76,7 +80,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@@ -88,7 +93,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@@ -97,11 +103,12 @@ static void add_mapping(struct string_list *map,\n \t}\n \n \tdebug_mm(\"mailmap:  '%s' <%s> -> '%s' <%s>\\n\",\n-\t\t debug_str(old_name), old_email, debug_str(new_name), debug_str(new_email));\n+\t\t debug_str(old_name), old_email,\n+\t\t debug_str(new_name), debug_str(new_email));\n }\n \n static char *parse_name_and_email(char *buffer, char **name,\n-\t\tchar **email, int allow_empty_email)\n+\t\t\t\t  char **email, int allow_empty_email)\n {\n \tchar *left, *right, *nstart, *nend;\n \t*name = *email = NULL;\n@@ -305,21 +312,25 @@ static struct string_list_item *lookup_prefix(struct string_list *map,\n }\n \n int map_user(struct string_list *map,\n-\t\t\t const char **email, size_t *emaillen,\n-\t\t\t const char **name, size_t *namelen)\n+\t     const char **email, size_t *emaillen,\n+\t     const char **name, size_t *namelen)\n {\n \tstruct string_list_item *item;\n \tstruct mailmap_entry *me;\n \n \tdebug_mm(\"map_user: map '%.*s' <%.*s>\\n\",\n-\t\t (int)*namelen, debug_str(*name), (int)*emaillen, debug_str(*email));\n+\t\t (int)*namelen, debug_str(*name),\n+\t\t (int)*emaillen, debug_str(*email));\n \n \titem = lookup_prefix(map, *email, *emaillen);\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\n+\t\t\t * name too. If the name is not found, we choose the\n+\t\t\t * 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@@ -340,8 +351,9 @@ int map_user(struct string_list *map,\n \t\t\t\t*name = mi->name;\n \t\t\t\t*namelen = strlen(*name);\n \t\t}\n-\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\", (int)*namelen, debug_str(*name),\n-\t\t\t\t (int)*emaillen, debug_str(*email));\n+\t\tdebug_mm(\"map_user:  to '%.*s' <%.*s>\\n\",\n+\t\t\t (int)*namelen, debug_str(*name),\n+\t\t\t (int)*emaillen, debug_str(*email));\n \t\treturn 1;\n \t}\n \tdebug_mm(\"map_user:  --\\n\");\n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223436","messageId":"7vwqordf7b.fsf@alter.siamese.dyndns.org","threadId":"34437","inReplyTo":"1373871253-96480-6-git-send-email-sunshine@sunshineco.com","subject":"Re: [PATCH v2 5/9] mailmap: debug: fix out-of-order fprintf() arguments","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-15T15:18:32Z","receivedAt":"2013-07-15T15:18:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> Resolve segmentation fault due to arguments passed in wrong order.\n>\n> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n\nThanks.  Shows that the debugging support hasn't been in use for\nquite a long time X-<.\n\n> ---\n>  mailmap.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/mailmap.c b/mailmap.c\n> index a7e92db..0516354 100644\n> --- a/mailmap.c\n> +++ b/mailmap.c\n> @@ -309,7 +309,7 @@ int map_user(struct string_list *map,\n>  \tstruct mailmap_entry *me;\n>  \n>  \tdebug_mm(\"map_user: map '%.*s' <%.*s>\\n\",\n> -\t\t *name, *namelen, *emaillen, *email);\n> +\t\t *namelen, *name, *emaillen, *email);\n>  \n>  \titem = lookup_prefix(map, *email, *emaillen);\n>  \tif (item != NULL) {\n"},{"id":"223437","messageId":"7vsizfdf07.fsf@alter.siamese.dyndns.org","threadId":"34437","inReplyTo":"1373871253-96480-10-git-send-email-sunshine@sunshineco.com","subject":"Re: [PATCH v2 9/9] mailmap: style fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-15T15:22:48Z","receivedAt":"2013-07-15T15:22:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, the whole series looks sensible.  Will replace and queue.\n"}]}