{"thread":{"id":"5994","subject":"[PATCH] Build in shortlog","startedAt":"2006-10-22T11:23:31Z","lastAt":"2006-11-11T21:36:05Z","messageCount":4,"participants":["Johannes Schindelin","A Large Angry SCM","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"29599","messageId":"Pine.LNX.4.63.0610221322370.14200@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5994","inReplyTo":null,"subject":"[PATCH] Build in shortlog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-10-22T11:23:31Z","receivedAt":"2006-10-22T11:23:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n Documentation/git-shortlog.txt |    1 +\n Makefile                       |    5 +-\n builtin-shortlog.c             |  302 ++++++++++++++++++++++++++++++++++++++++\n builtin.h                      |    1 +\n git-shortlog.perl              |  234 -------------------------------\n git.c                          |    1 +\n path-list.c                    |    2 +-\n 7 files changed, 309 insertions(+), 237 deletions(-)\n\ndiff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt\nindex d54fc3e..95fa901 100644\n--- a/Documentation/git-shortlog.txt\n+++ b/Documentation/git-shortlog.txt\n@@ -8,6 +8,7 @@ git-shortlog - Summarize 'git log' outpu\n SYNOPSIS\n --------\n git-log --pretty=short | 'git-shortlog' [-h] [-n] [-s]\n+git-shortlog [-n|--number] [-s|--summary] [<committish>...]\n \n DESCRIPTION\n -----------\ndiff --git a/Makefile b/Makefile\nindex 018dad2..0beda57 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -106,7 +106,7 @@ uname_P := $(shell sh -c 'uname -p 2>/de\n \n # CFLAGS and LDFLAGS are for the users to override from the command line.\n \n-CFLAGS = -g -O2 -Wall\n+CFLAGS = -g -O0 -Wall\n LDFLAGS =\n ALL_CFLAGS = $(CFLAGS)\n ALL_LDFLAGS = $(LDFLAGS)\n@@ -178,7 +178,7 @@ SCRIPT_SH = \\\n \n SCRIPT_PERL = \\\n \tgit-archimport.perl git-cvsimport.perl git-relink.perl \\\n-\tgit-shortlog.perl git-rerere.perl \\\n+\tgit-rerere.perl \\\n \tgit-cvsserver.perl \\\n \tgit-svnimport.perl git-cvsexportcommit.perl \\\n \tgit-send-email.perl git-svn.perl\n@@ -306,6 +306,7 @@ BUILTIN_OBJS = \\\n \tbuiltin-rev-parse.o \\\n \tbuiltin-rm.o \\\n \tbuiltin-runstatus.o \\\n+\tbuiltin-shortlog.o \\\n \tbuiltin-show-branch.o \\\n \tbuiltin-stripspace.o \\\n \tbuiltin-symbolic-ref.o \\\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nnew file mode 100644\nindex 0000000..df60bd2\n--- /dev/null\n+++ b/builtin-shortlog.c\n@@ -0,0 +1,302 @@\n+#include \"builtin.h\"\n+#include \"cache.h\"\n+#include \"commit.h\"\n+#include \"diff.h\"\n+#include \"path-list.h\"\n+#include \"revision.h\"\n+#include <string.h>\n+\n+static const char shortlog_usage[] =\n+\"git-shortlog [-n] [-s] [<commit-id>... ]\\n\";\n+\n+static int compare_by_number(const void *a1, const void *a2)\n+{\n+\tconst struct path_list_item *i1 = a1, *i2 = a2;\n+\tconst struct path_list *l1 = i1->util, *l2 = i2->util;\n+\n+\tif (l1->nr < l2->nr)\n+\t\treturn -1;\n+\telse if (l1->nr == l2->nr)\n+\t\treturn 0;\n+\telse\n+\t\treturn +1;\n+}\n+\n+static struct path_list_item mailmap_list[] = {\n+\t{ \"R.Marek@sh.cvut.cz\", (void*)\"Rudolf Marek\" },\n+\t{ \"Ralf.Wildenhues@gmx.de\", (void*)\"Ralf Wildenhues\" },\n+\t{ \"aherrman@de.ibm.com\", (void*)\"Andreas Herrmann\" },\n+\t{ \"akpm@osdl.org\", (void*)\"Andrew Morton\" },\n+\t{ \"andrew.vasquez@qlogic.com\", (void*)\"Andrew Vasquez\" },\n+\t{ \"aquynh@gmail.com\", (void*)\"Nguyen Anh Quynh\" },\n+\t{ \"axboe@suse.de\", (void*)\"Jens Axboe\" },\n+\t{ \"blaisorblade@yahoo.it\", (void*)\"Paolo 'Blaisorblade' Giarrusso\" },\n+\t{ \"bunk@stusta.de\", (void*)\"Adrian Bunk\" },\n+\t{ \"domen@coderock.org\", (void*)\"Domen Puncer\" },\n+\t{ \"dougg@torque.net\", (void*)\"Douglas Gilbert\" },\n+\t{ \"dwmw2@shinybook.infradead.org\", (void*)\"David Woodhouse\" },\n+\t{ \"ecashin@coraid.com\", (void*)\"Ed L Cashin\" },\n+\t{ \"felix@derklecks.de\", (void*)\"Felix Moeller\" },\n+\t{ \"fzago@systemfabricworks.com\", (void*)\"Frank Zago\" },\n+\t{ \"gregkh@suse.de\", (void*)\"Greg Kroah-Hartman\" },\n+\t{ \"hch@lst.de\", (void*)\"Christoph Hellwig\" },\n+\t{ \"htejun@gmail.com\", (void*)\"Tejun Heo\" },\n+\t{ \"jejb@mulgrave.(none)\", (void*)\"James Bottomley\" },\n+\t{ \"jejb@titanic.il.steeleye.com\", (void*)\"James Bottomley\" },\n+\t{ \"jgarzik@pretzel.yyz.us\", (void*)\"Jeff Garzik\" },\n+\t{ \"johnpol@2ka.mipt.ru\", (void*)\"Evgeniy Polyakov\" },\n+\t{ \"kay.sievers@vrfy.org\", (void*)\"Kay Sievers\" },\n+\t{ \"minyard@acm.org\", (void*)\"Corey Minyard\" },\n+\t{ \"mshah@teja.com\", (void*)\"Mitesh shah\" },\n+\t{ \"pj@ludd.ltu.se\", (void*)\"Peter A Jonsson\" },\n+\t{ \"rmps@joel.ist.utl.pt\", (void*)\"Rui Saraiva\" },\n+\t{ \"santtu.hyrkko@gmail.com\", (void*)\"Santtu Hyrkk\u001b,Av\u001b(B\" },\n+\t{ \"simon@thekelleys.org.uk\", (void*)\"Simon Kelley\" },\n+\t{ \"ssant@in.ibm.com\", (void*)\"Sachin P Sant\" },\n+\t{ \"terra@gnome.org\", (void*)\"Morten Welinder\" },\n+\t{ \"tony.luck@intel.com\", (void*)\"Tony Luck\" },\n+\t{ \"welinder@anemone.rentec.com\", (void*)\"Morten Welinder\" },\n+\t{ \"welinder@darter.rentec.com\", (void*)\"Morten Welinder\" },\n+\t{ \"welinder@troll.com\", (void*)\"Morten Welinder\" }\n+};\n+\n+static struct path_list mailmap = {\n+\tmailmap_list,\n+\tsizeof(mailmap_list) / sizeof(struct path_list_item), 0, 0\n+};\n+\n+static int map_email(char *email, char *name, int maxlen)\n+{\n+\tchar *p;\n+\tstruct path_list_item *item;\n+\n+\t/* autocomplete common developers */\n+\tp = strchr(email, '>');\n+\tif (!p)\n+\t\treturn 0;\n+\n+\t*p = '\\0';\n+\titem = path_list_lookup(email, &mailmap);\n+\tif (item != NULL) {\n+\t\tconst char *realname = (const char *)item->util;\n+\t\tstrncpy(name, realname, maxlen);\n+\t\treturn 1;\n+\t}\n+\treturn 0;\n+}\n+\n+static void insert_author_oneline(struct path_list *list,\n+\t\tconst char *author, int authorlen,\n+\t\tconst char *oneline, int onelinelen)\n+{\n+\tconst char *dot3 = \"/pub/scm/linux/kernel/git/\";\n+\tchar *buffer, *p;\n+\tstruct path_list_item *item;\n+\tstruct path_list *onelines;\n+\n+\twhile (authorlen > 0 && isspace(author[authorlen - 1]))\n+\t\tauthorlen--;\n+\n+\tbuffer = xmalloc(authorlen + 1);\n+\tmemcpy(buffer, author, authorlen);\n+\tbuffer[authorlen] = '\\0';\n+\n+\titem = path_list_insert(buffer, list);\n+\tif (item->util == NULL)\n+\t\titem->util = xcalloc(1, sizeof(struct path_list));\n+\telse\n+\t\tfree(buffer);\n+\n+\tif (!strncmp(oneline, \"[PATCH\", 6)) {\n+\t\tchar *eob = strchr(buffer, ']');\n+\n+\t\twhile (isspace(eob[1]) && eob[1] != '\\n')\n+\t\t\teob++;\n+\t\tif (eob - oneline < onelinelen) {\n+\t\t\tonelinelen -= eob - oneline;\n+\t\t\toneline = eob;\n+\t\t}\n+\t}\n+\n+\twhile (onelinelen > 0 && isspace(oneline[0])) {\n+\t\toneline++;\n+\t\tonelinelen--;\n+\t}\n+\n+\twhile (onelinelen > 0 && isspace(oneline[onelinelen - 1]))\n+\t\tonelinelen--;\n+\n+\tbuffer = xmalloc(onelinelen + 1);\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+\t}\n+\n+\n+\tonelines = item->util;\n+\tif (onelines->nr >= onelines->alloc) {\n+\t\tonelines->alloc = alloc_nr(onelines->nr);\n+\t\tonelines->items = xrealloc(onelines->items,\n+\t\t\t\tonelines->alloc\n+\t\t\t\t* sizeof(struct path_list_item));\n+\t}\n+\n+\tonelines->items[onelines->nr].util = NULL;\n+\tonelines->items[onelines->nr++].path = buffer;\n+}\n+\n+static void read_from_stdin(struct path_list *list)\n+{\n+\tchar buffer[1024];\n+\n+\twhile (fgets(buffer, sizeof(buffer), stdin) != NULL) {\n+\t\tchar *bob;\n+\t\tif ((buffer[0] == 'A' || buffer[0] == 'a') &&\n+\t\t\t\t!strncmp(buffer + 1, \"uthor: \", 7) &&\n+\t\t\t\t(bob = strchr(buffer + 7, '<')) != NULL) {\n+\t\t\tchar buffer2[1024], offset = 0;\n+\n+\t\t\tif (map_email(bob + 1, buffer, sizeof(buffer)))\n+\t\t\t\tbob = buffer + strlen(buffer);\n+\t\t\telse {\n+\t\t\t\toffset = 8;\n+\t\t\t\twhile (isspace(bob[-1]))\n+\t\t\t\t\tbob--;\n+\t\t\t}\n+\n+\t\t\twhile (fgets(buffer2, sizeof(buffer2), stdin) &&\n+\t\t\t\t\tbuffer2[0] != '\\n')\n+\t\t\t\t; /* chomp input */\n+\t\t\tif (fgets(buffer2, sizeof(buffer2), stdin))\n+\t\t\t\tinsert_author_oneline(list,\n+\t\t\t\t\t\tbuffer + offset,\n+\t\t\t\t\t\tbob - buffer - offset,\n+\t\t\t\t\t\tbuffer2, strlen(buffer2));\n+\t\t}\n+\t}\n+}\n+\n+static void get_from_rev(struct rev_info *rev, struct path_list *list)\n+{\n+\tchar scratch[1024];\n+\tstruct commit *commit;\n+\n+\tprepare_revision_walk(rev);\n+\twhile ((commit = get_revision(rev)) != NULL) {\n+\t\tchar *author = NULL, *oneline, *buffer;\n+\t\tint authorlen, onelinelen;\n+\n+\t\t/* get author and oneline */\n+\t\tfor (buffer = commit->buffer; buffer && *buffer != '\\0' &&\n+\t\t\t\t*buffer != '\\n'; ) {\n+\t\t\tchar *eol = strchr(buffer, '\\n');\n+\n+\t\t\tif (eol == NULL)\n+\t\t\t\teol = buffer + strlen(buffer);\n+\t\t\telse\n+\t\t\t\teol++;\n+\n+\t\t\tif (!strncmp(buffer, \"author \", 7)) {\n+\t\t\t\tchar *bracket = strchr(buffer, '<');\n+\n+\t\t\t\tif (bracket == NULL || bracket > eol)\n+\t\t\t\t\tdie(\"Invalid commit buffer: %s\",\n+\t\t\t\t\t    sha1_to_hex(commit->object.sha1));\n+\n+\t\t\t\tif (map_email(bracket + 1, scratch,\n+\t\t\t\t\t\t\tsizeof(scratch))) {\n+\t\t\t\t\tauthor = scratch;\n+\t\t\t\t\tauthorlen = strlen(scratch);\n+\t\t\t\t} else {\n+\t\t\t\t\twhile (bracket[-1] == ' ')\n+\t\t\t\t\t\tbracket--;\n+\n+\t\t\t\t\tauthor = buffer + 7;\n+\t\t\t\t\tauthorlen = bracket - buffer - 7;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tbuffer = eol;\n+\t\t}\n+\n+\t\tif (author == NULL)\n+\t\t\tdie (\"Missing author: %s\",\n+\t\t\t\t\tsha1_to_hex(commit->object.sha1));\n+\n+\t\tif (buffer == NULL || *buffer == '\\0') {\n+\t\t\toneline = \"<none>\";\n+\t\t\tonelinelen = sizeof(oneline) + 1;\n+\t\t} else {\n+\t\t\tchar *eol;\n+\n+\t\t\toneline = buffer + 1;\n+\t\t\teol = strchr(oneline, '\\n');\n+\t\t\tif (eol == NULL)\n+\t\t\t\tonelinelen = strlen(oneline);\n+\t\t\telse\n+\t\t\t\tonelinelen = eol - oneline;\n+\t\t}\n+\n+\t\tinsert_author_oneline(list,\n+\t\t\t\tauthor, authorlen, oneline, onelinelen);\n+\t}\n+\n+}\n+\n+int cmd_shortlog(int argc, const char **argv, const char *prefix)\n+{\n+\tstruct rev_info rev;\n+\tstruct path_list list = { NULL, 0, 0, 1 };\n+\tint i, j, sort_by_number = 0, summary = 0;\n+\n+\tinit_revisions(&rev, prefix);\n+\targc = setup_revisions(argc, argv, &rev, NULL);\n+\twhile (argc > 1) {\n+\t\tif (!strcmp(argv[1], \"-n\") || !strcmp(argv[1], \"--numbered\"))\n+\t\t\tsort_by_number = 1;\n+\t\telse if (!strcmp(argv[1], \"-s\") ||\n+\t\t\t\t!strcmp(argv[1], \"--summary\"))\n+\t\t\tsummary = 1;\n+\t\telse if (!strcmp(argv[1], \"-h\") || !strcmp(argv[1], \"--help\"))\n+\t\t\tusage(shortlog_usage);\n+\t\telse\n+\t\t\tdie (\"unrecognized argument: %s\", argv[1]);\n+\t\targv++;\n+\t\targc--;\n+\t}\n+\n+\tif (rev.pending.nr == 1)\n+\t\tdie (\"Need a range!\");\n+\telse if (rev.pending.nr == 0)\n+\t\tread_from_stdin(&list);\n+\telse\n+\t\tget_from_rev(&rev, &list);\n+\n+\tif (sort_by_number)\n+\t\tqsort(list.items, sizeof(struct path_list_item), list.nr,\n+\t\t\tcompare_by_number);\n+\n+\tfor (i = 0; i < list.nr; i++) {\n+\t\tstruct path_list *onelines = list.items[i].util;\n+\n+\t\tprintf(\"%s (%d):\\n\", list.items[i].path, onelines->nr);\n+\t\tif (!summary) {\n+\t\t\tfor (j = onelines->nr - 1; j >= 0; j--)\n+\t\t\t\tprintf(\"      %s\\n\", onelines->items[j].path);\n+\t\t\tprintf(\"\\n\");\n+\t\t}\n+\n+\t\tonelines->strdup_paths = 1;\n+\t\tpath_list_clear(onelines, 1);\n+\t\tfree(onelines);\n+\t\tlist.items[i].util = NULL;\n+\t}\n+\n+\tlist.strdup_paths = 1;\n+\tpath_list_clear(&list, 1);\n+\n+\treturn 0;\n+}\n+\ndiff --git a/builtin.h b/builtin.h\nindex 9683a7c..0ce8f8b 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -51,6 +51,7 @@ extern int cmd_rev_list(int argc, const \n extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);\n extern int cmd_rm(int argc, const char **argv, const char *prefix);\n extern int cmd_runstatus(int argc, const char **argv, const char *prefix);\n+extern int cmd_shortlog(int argc, const char **argv, const char *prefix);\n extern int cmd_show(int argc, const char **argv, const char *prefix);\n extern int cmd_show_branch(int argc, const char **argv, const char *prefix);\n extern int cmd_stripspace(int argc, const char **argv, const char *prefix);\ndiff --git a/git-shortlog.perl b/git-shortlog.perl\ndeleted file mode 100755\nindex 334fec7..0000000\n--- a/git-shortlog.perl\n+++ /dev/null\n@@ -1,234 +0,0 @@\n-#!/usr/bin/perl -w\n-\n-use strict;\n-use Getopt::Std;\n-use File::Basename qw(basename dirname);\n-\n-our ($opt_h, $opt_n, $opt_s);\n-getopts('hns');\n-\n-$opt_h && usage();\n-\n-sub usage {\n-\tprint STDERR \"Usage: ${\\basename $0} [-h] [-n] [-s] < <log_data>\\n\";\n-        exit(1);\n-}\n-\n-my (%mailmap);\n-my (%email);\n-my (%map);\n-my $pstate = 1;\n-my $n_records = 0;\n-my $n_output = 0;\n-\n-sub shortlog_entry($$) {\n-\tmy ($name, $desc) = @_;\n-\tmy $key = $name;\n-\n-\t$desc =~ s#/pub/scm/linux/kernel/git/#/.../#g;\n-\t$desc =~ s#\\[PATCH\\] ##g;\n-\n-\t# store description in array, in email->{desc list} map\n-\tif (exists $map{$key}) {\n-\t\t# grab ref\n-\t\tmy $obj = $map{$key};\n-\n-\t\t# add desc to array\n-\t\tpush(@$obj, $desc);\n-\t} else {\n-\t\t# create new array, containing 1 item\n-\t\tmy @arr = ($desc);\n-\n-\t\t# store ref to array\n-\t\t$map{$key} = \\@arr;\n-\t}\n-}\n-\n-# sort comparison function\n-sub by_name($$) {\n-\tmy ($a, $b) = @_;\n-\n-\tuc($a) cmp uc($b);\n-}\n-sub by_nbentries($$) {\n-\tmy ($a, $b) = @_;\n-\tmy $a_entries = $map{$a};\n-\tmy $b_entries = $map{$b};\n-\n-\t@$b_entries - @$a_entries || by_name $a, $b;\n-}\n-\n-my $sort_method = $opt_n ? \\&by_nbentries : \\&by_name;\n-\n-sub summary_output {\n-\tmy ($obj, $num, $key);\n-\n-\tforeach $key (sort $sort_method keys %map) {\n-\t\t$obj = $map{$key};\n-\t\t$num = @$obj;\n-\t\tprintf \"%s: %u\\n\", $key, $num;\n-\t\t$n_output += $num;\n-\t}\n-}\n-\n-sub shortlog_output {\n-\tmy ($obj, $num, $key, $desc);\n-\n-\tforeach $key (sort $sort_method keys %map) {\n-\t\t$obj = $map{$key};\n-\t\t$num = @$obj;\n-\n-\t\t# output author\n-\t\tprintf \"%s (%u):\\n\", $key, $num;\n-\n-\t\t# output author's 1-line summaries\n-\t\tforeach $desc (reverse @$obj) {\n-\t\t\tprint \"  $desc\\n\";\n-\t\t\t$n_output++;\n-\t\t}\n-\n-\t\t# blank line separating author from next author\n-\t\tprint \"\\n\";\n-\t}\n-}\n-\n-sub changelog_input {\n-\tmy ($author, $desc);\n-\n-\twhile (<>) {\n-\t\t# get author and email\n-\t\tif ($pstate == 1) {\n-\t\t\tmy ($email);\n-\n-\t\t\tnext unless /^[Aa]uthor:?\\s*(.*?)\\s*<(.*)>/;\n-\n-\t\t\t$n_records++;\n-\n-\t\t\t$author = $1;\n-\t\t\t$email = $2;\n-\t\t\t$desc = undef;\n-\n-\t\t\t# cset author fixups\n-\t\t\tif (exists $mailmap{$email}) {\n-\t\t\t\t$author = $mailmap{$email};\n-\t\t\t} elsif (exists $mailmap{$author}) {\n-\t\t\t\t$author = $mailmap{$author};\n-\t\t\t} elsif (!$author) {\n-\t\t\t\t$author = $email;\n-\t\t\t}\n-\t\t\t$email{$author}{$email}++;\n-\t\t\t$pstate++;\n-\t\t}\n-\n-\t\t# skip to blank line\n-\t\telsif ($pstate == 2) {\n-\t\t\tnext unless /^\\s*$/;\n-\t\t\t$pstate++;\n-\t\t}\n-\n-\t\t# skip to non-blank line\n-\t\telsif ($pstate == 3) {\n-\t\t\tnext unless /^\\s*?(.*)/;\n-\n-\t\t\t# skip lines that are obviously not\n-\t\t\t# a 1-line cset description\n-\t\t\tnext if /^\\s*From: /;\n-\n-\t\t\tchomp;\n-\t\t\t$desc = $1;\n-\n-\t\t\t&shortlog_entry($author, $desc);\n-\n-\t\t\t$pstate = 1;\n-\t\t}\n-\t\n-\t\telse {\n-\t\t\tdie \"invalid parse state $pstate\";\n-\t\t}\n-\t}\n-}\n-\n-sub read_mailmap {\n-\tmy ($fh, $mailmap) = @_;\n-\twhile (<$fh>) {\n-\t\tchomp;\n-\t\tif (/^([^#].*?)\\s*<(.*)>/) {\n-\t\t\t$mailmap->{$2} = $1;\n-\t\t}\n-\t}\n-}\n-\n-sub setup_mailmap {\n-\tread_mailmap(\\*DATA, \\%mailmap);\n-\tif (-f '.mailmap') {\n-\t\tmy $fh = undef;\n-\t\topen $fh, '<', '.mailmap';\n-\t\tread_mailmap($fh, \\%mailmap);\n-\t\tclose $fh;\n-\t}\n-}\n-\n-sub finalize {\n-\t#print \"\\n$n_records records parsed.\\n\";\n-\n-\tif ($n_records != $n_output) {\n-\t\tdie \"parse error: input records != output records\\n\";\n-\t}\n-\tif (0) {\n-\t\tfor my $author (sort keys %email) {\n-\t\t\tmy $e = $email{$author};\n-\t\t\tfor my $email (sort keys %$e) {\n-\t\t\t\tprint STDERR \"$author <$email>\\n\";\n-\t\t\t}\n-\t\t}\n-\t}\n-}\n-\n-&setup_mailmap;\n-&changelog_input;\n-$opt_s ? &summary_output : &shortlog_output;\n-&finalize;\n-exit(0);\n-\n-\n-__DATA__\n-#\n-# Even with git, we don't always have name translations.\n-# So have an email->real name table to translate the\n-# (hopefully few) missing names\n-#\n-Adrian Bunk <bunk@stusta.de>\n-Andreas Herrmann <aherrman@de.ibm.com>\n-Andrew Morton <akpm@osdl.org>\n-Andrew Vasquez <andrew.vasquez@qlogic.com>\n-Christoph Hellwig <hch@lst.de>\n-Corey Minyard <minyard@acm.org>\n-David Woodhouse <dwmw2@shinybook.infradead.org>\n-Domen Puncer <domen@coderock.org>\n-Douglas Gilbert <dougg@torque.net>\n-Ed L Cashin <ecashin@coraid.com>\n-Evgeniy Polyakov <johnpol@2ka.mipt.ru>\n-Felix Moeller <felix@derklecks.de>\n-Frank Zago <fzago@systemfabricworks.com>\n-Greg Kroah-Hartman <gregkh@suse.de>\n-James Bottomley <jejb@mulgrave.(none)>\n-James Bottomley <jejb@titanic.il.steeleye.com>\n-Jeff Garzik <jgarzik@pretzel.yyz.us>\n-Jens Axboe <axboe@suse.de>\n-Kay Sievers <kay.sievers@vrfy.org>\n-Mitesh shah <mshah@teja.com>\n-Morten Welinder <terra@gnome.org>\n-Morten Welinder <welinder@anemone.rentec.com>\n-Morten Welinder <welinder@darter.rentec.com>\n-Morten Welinder <welinder@troll.com>\n-Nguyen Anh Quynh <aquynh@gmail.com>\n-Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n-Peter A Jonsson <pj@ludd.ltu.se>\n-Ralf Wildenhues <Ralf.Wildenhues@gmx.de>\n-Rudolf Marek <R.Marek@sh.cvut.cz>\n-Rui Saraiva <rmps@joel.ist.utl.pt>\n-Sachin P Sant <ssant@in.ibm.com>\n-Santtu Hyrkk\u001b,Av\u001b(B <santtu.hyrkko@gmail.com>\n-Simon Kelley <simon@thekelleys.org.uk>\n-Tejun Heo <htejun@gmail.com>\n-Tony Luck <tony.luck@intel.com>\ndiff --git a/git.c b/git.c\nindex 8044667..771e8ee 100644\n--- a/git.c\n+++ b/git.c\n@@ -262,6 +262,7 @@ static void handle_internal_command(int \n \t\t{ \"rev-parse\", cmd_rev_parse, RUN_SETUP },\n \t\t{ \"rm\", cmd_rm, RUN_SETUP },\n \t\t{ \"runstatus\", cmd_runstatus, RUN_SETUP },\n+\t\t{ \"shortlog\", cmd_shortlog, RUN_SETUP },\n \t\t{ \"show-branch\", cmd_show_branch, RUN_SETUP },\n \t\t{ \"show\", cmd_show, RUN_SETUP | USE_PAGER },\n \t\t{ \"stripspace\", cmd_stripspace },\ndiff --git a/path-list.c b/path-list.c\nindex 0c332dc..f8800f8 100644\n--- a/path-list.c\n+++ b/path-list.c\n@@ -57,7 +57,7 @@ struct path_list_item *path_list_insert(\n \tint index = add_entry(list, path);\n \n \tif (index < 0)\n-\t\tindex = 1 - index;\n+\t\tindex = -1 - index;\n \n \treturn list->items + index;\n }\n-- \n1.4.3.1.ge8ca-dirty\n"},{"id":"29649","messageId":"453BA8E9.8010703@gmail.com","threadId":"5994","inReplyTo":"Pine.LNX.4.63.0610221322370.14200@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Build in shortlog","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2006-10-22T17:22:49Z","receivedAt":"2006-10-22T17:22:49Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"Johannes Schindelin wrote:\n[...]\n> diff --git a/Makefile b/Makefile\n> index 018dad2..0beda57 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -106,7 +106,7 @@ uname_P := $(shell sh -c 'uname -p 2>/de\n>  \n>  # CFLAGS and LDFLAGS are for the users to override from the command line.\n>  \n> -CFLAGS = -g -O2 -Wall\n> +CFLAGS = -g -O0 -Wall\n>  LDFLAGS =\n>  ALL_CFLAGS = $(CFLAGS)\n>  ALL_LDFLAGS = $(LDFLAGS)\n> @@ -178,7 +178,7 @@ SCRIPT_SH = \\\n[...]\n\nThis part of your patch needs some explanation.\n"},{"id":"29671","messageId":"Pine.LNX.4.63.0610222248350.14200@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5994","inReplyTo":"453BA8E9.8010703@gmail.com","subject":"Re: [PATCH] Build in shortlog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-10-22T20:50:08Z","receivedAt":"2006-10-22T20:50:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 22 Oct 2006, A Large Angry SCM wrote:\n\n> Johannes Schindelin wrote:\n> [...]\n> > diff --git a/Makefile b/Makefile\n> > index 018dad2..0beda57 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -106,7 +106,7 @@ uname_P := $(shell sh -c 'uname -p 2>/de\n> >   # CFLAGS and LDFLAGS are for the users to override from the command line.\n> >  -CFLAGS = -g -O2 -Wall\n> > +CFLAGS = -g -O0 -Wall\n> >  LDFLAGS =\n> >  ALL_CFLAGS = $(CFLAGS)\n> >  ALL_LDFLAGS = $(LDFLAGS)\n> > @@ -178,7 +178,7 @@ SCRIPT_SH = \\\n> [...]\n> \n> This part of your patch needs some explanation.\n\nEasy. Too many Czech beer, and not enough sleep. Therefore not enough \nremoving debug remnants.\n\nJunio, if you want to apply, could you please edit this part out?\n\nCiao,\nDscho\n"},{"id":"297131","messageId":"7virhlis3e.fsf@assigned-by-dhcp.cox.net","threadId":"5994","inReplyTo":"Pine.LNX.4.63.0610221322370.14200@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Build in shortlog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-11T21:36:05Z","receivedAt":"2006-11-11T21:36:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> diff --git a/path-list.c b/path-list.c\n> index 0c332dc..f8800f8 100644\n> --- a/path-list.c\n> +++ b/path-list.c\n> @@ -57,7 +57,7 @@ struct path_list_item *path_list_insert(\n>  \tint index = add_entry(list, path);\n>  \n>  \tif (index < 0)\n> -\t\tindex = 1 - index;\n> +\t\tindex = -1 - index;\n>  \n>  \treturn list->items + index;\n>  }\n\nThis part looks like a genuine bugfix and unrelated to\nshortlog.\n\nMany callers of path_list_insert() seem to ignore its return\nvalue, but merge_recursive.c seems to use it in three places, to\nfind an entry to hang cached rename information to in\ninsert_stage_data().\n\nI haven't come up with an example to demonstrate the breakage of\nnot having this fix in the existing git-merge-recursive, but I\nthink this needs to be applied to even 'maint'.\n\n\n"}]}