builtin git-shortlog is broken
Another small patch to fix the output result to be conform with the perl version. Signed-off-by: Nicolas Pitre <nico@cam.org> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre committed
Nov 21, 2006 at 15:49 UTC
ac60c94d74ff3341a5175ca865fd52a0a0189146
1 file changed
+5
-3
builtin-shortlog.c
+5
-3
@@ -7,7 +7,7 @@
7
#include <string.h>
8
9
static const char shortlog_usage[] =
10
-"git-shortlog [-n] [-s] [<commit-id>... ]\n";
10
+"git-shortlog [-n] [-s] [<commit-id>... ]";
11
12
static int compare_by_number(const void *a1, const void *a2)
13
{
@@ -287,8 +287,10 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
287
for (i = 0; i < list.nr; i++) {
288
struct path_list *onelines = list.items[i].util;
289
290
- printf("%s (%d):\n", list.items[i].path, onelines->nr);
291
- if (!summary) {
290
+ if (summary) {
291
+ printf("%s: %d\n", list.items[i].path, onelines->nr);
292
+ } else {
293
+ printf("%s (%d):\n", list.items[i].path, onelines->nr);
294
for (j = onelines->nr - 1; j >= 0; j--)
295
printf(" %s\n", onelines->items[j].path);
296
printf("\n");