From ac60c94d74ff3341a5175ca865fd52a0a0189146 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 21 Nov 2006 15:49:45 -0500 Subject: 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 Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin-shortlog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'builtin-shortlog.c') diff --git a/builtin-shortlog.c b/builtin-shortlog.c index 1456e1a19..b760b477e 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -7,7 +7,7 @@ #include static const char shortlog_usage[] = -"git-shortlog [-n] [-s] [... ]\n"; +"git-shortlog [-n] [-s] [... ]"; static int compare_by_number(const void *a1, const void *a2) { @@ -287,8 +287,10 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) for (i = 0; i < list.nr; i++) { struct path_list *onelines = list.items[i].util; - printf("%s (%d):\n", list.items[i].path, onelines->nr); - if (!summary) { + if (summary) { + printf("%s: %d\n", list.items[i].path, onelines->nr); + } else { + printf("%s (%d):\n", list.items[i].path, onelines->nr); for (j = onelines->nr - 1; j >= 0; j--) printf(" %s\n", onelines->items[j].path); printf("\n"); -- cgit v1.2.1