{"thread":{"id":"43579","subject":"[PATCH 1/2] git-shortlog: fix common repository prefix abbreviation.","startedAt":"2006-11-25T08:10:57Z","lastAt":"2006-11-25T08:10:57Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"295696","messageId":"7vfyc854ku.fsf@assigned-by-dhcp.cox.net","threadId":"43579","inReplyTo":null,"subject":"[PATCH 1/2] git-shortlog: fix common repository prefix abbreviation.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-25T08:10:57Z","receivedAt":"2006-11-25T08:10:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The code to abbreviate the common repository prefix was totally\nborked.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n builtin-shortlog.c |   13 +++++++++----\n 1 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex b760b47..bdd952c 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -130,12 +130,17 @@ static void insert_author_oneline(struct path_list *list,\n \tmemcpy(buffer, oneline, onelinelen);\n \tbuffer[onelinelen] = '\\0';\n \n-\twhile ((p = strstr(buffer, dot3)) != NULL) {\n-\t\tmemcpy(p, \"...\", 3);\n-\t\tstrcpy(p + 2, p + sizeof(dot3) - 1);\n+\tif (dot3) {\n+\t\tint dot3len = strlen(dot3);\n+\t\tif (dot3len > 5) {\n+\t\t\twhile ((p = strstr(buffer, dot3)) != NULL) {\n+\t\t\t\tint taillen = strlen(p) - dot3len;\n+\t\t\t\tmemcpy(p, \"/.../\", 5);\n+\t\t\t\tmemmove(p + 5, p + dot3len, taillen + 1);\n+\t\t\t}\n+\t\t}\n \t}\n \n-\n \tonelines = item->util;\n \tif (onelines->nr >= onelines->alloc) {\n \t\tonelines->alloc = alloc_nr(onelines->nr);\n-- \n1.4.4.1.g61fba\n\n"}]}