summaryrefslogtreecommitdiff
path: root/builtin-shortlog.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2006-11-21 15:49:45 -0500
committerJunio C Hamano <junkio@cox.net>2006-11-21 14:31:34 -0800
commitac60c94d74ff3341a5175ca865fd52a0a0189146 (patch)
treee72a367853b872b957a503a9173c81fbd00b01bc /builtin-shortlog.c
parent6d6ab6104a5055b9f66cc9a80d55d2ef59d0763c (diff)
downloadgit-ac60c94d74ff3341a5175ca865fd52a0a0189146.tar.gz
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>
Diffstat (limited to 'builtin-shortlog.c')
-rw-r--r--builtin-shortlog.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 1456e1a191..b760b477ea 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -7,7 +7,7 @@
#include <string.h>
static const char shortlog_usage[] =
-"git-shortlog [-n] [-s] [<commit-id>... ]\n";
+"git-shortlog [-n] [-s] [<commit-id>... ]";
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");