summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3af0698)
raw | patch | inline | side by side (parent: 3af0698)
author | Eric Wong <normalperson@yhbt.net> | |
Mon, 30 Jan 2006 00:28:02 +0000 (16:28 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 1 Feb 2006 00:23:03 +0000 (16:23 -0800) |
This builds on top of the previous one.
Traditionally, head(1) and tail(1) allow their line limits to be
parsed this way.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Traditionally, head(1) and tail(1) allow their line limits to be
parsed this way.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
rev-list.c | patch | blob | history | |
rev-parse.c | patch | blob | history |
diff --git a/rev-list.c b/rev-list.c
index 45657552177a588a53ff77393c46094da2249798..1bc1887fdbbf06400ba4ac23e272770f1608dbe1 100644 (file)
--- a/rev-list.c
+++ b/rev-list.c
struct commit *commit;
unsigned char sha1[20];
+ /* accept -<digit>, like traditilnal "head" */
+ if ((*arg == '-') && isdigit(arg[1])) {
+ max_count = atoi(arg + 1);
+ continue;
+ }
if (!strcmp(arg, "-n")) {
if (++i >= argc)
die("-n requires an argument");
diff --git a/rev-parse.c b/rev-parse.c
index 3c99a79eb354036137a28cc586ca58555f6162bc..6bf205a8f53c6af76bb1cc4df7bf37e46d378890 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
};
const char **p = rev_args;
+ /* accept -<digit>, like traditional "head" */
+ if ((*arg == '-') && isdigit(arg[1]))
+ return 1;
+
for (;;) {
const char *str = *p++;
int len;