summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5496523)
raw | patch | inline | side by side (parent: 5496523)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 21 Nov 2006 20:12:06 +0000 (21:12 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 21 Nov 2006 22:31:15 +0000 (14:31 -0800) |
Since it is now a builtin optionally taking a range, we have to parse
the options before the rev machinery, to be able to shadow the short
hand "-n" for "--max-count".
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
the options before the rev machinery, to be able to shadow the short
hand "-n" for "--max-count".
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-shortlog.c | patch | blob | history |
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 4775c110ffa1de7603300b2ddc6bc18301d05789..1456e1a1914c0a5a0f0009ef391066d1d67d5280 100644 (file)
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
const struct path_list *l1 = i1->util, *l2 = i2->util;
if (l1->nr < l2->nr)
- return -1;
+ return 1;
else if (l1->nr == l2->nr)
return 0;
else
- return +1;
+ return -1;
}
static struct path_list mailmap = {NULL, 0, 0, 0};
struct path_list list = { NULL, 0, 0, 1 };
int i, j, sort_by_number = 0, summary = 0;
- init_revisions(&rev, prefix);
- argc = setup_revisions(argc, argv, &rev, NULL);
+ /* since -n is a shadowed rev argument, parse our args first */
while (argc > 1) {
if (!strcmp(argv[1], "-n") || !strcmp(argv[1], "--numbered"))
sort_by_number = 1;
else if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))
usage(shortlog_usage);
else
- die ("unrecognized argument: %s", argv[1]);
+ break;
argv++;
argc--;
}
+ init_revisions(&rev, prefix);
+ argc = setup_revisions(argc, argv, &rev, NULL);
+ if (argc > 1)
+ die ("unrecognized argument: %s", argv[1]);
if (!access(".mailmap", R_OK))
read_mailmap(".mailmap");
get_from_rev(&rev, &list);
if (sort_by_number)
- qsort(list.items, sizeof(struct path_list_item), list.nr,
+ qsort(list.items, list.nr, sizeof(struct path_list_item),
compare_by_number);
for (i = 0; i < list.nr; i++) {