summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-02 23:24:01 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-02 23:24:01 (GMT)
commit64bc6e3db54ef9e2accfdb8e6c8168f789946fcb (patch)
tree48eeaef44a1d278e4f7fb8e69869308bd43aa502 /git.c
parent7ae0b0cb65f069b657155abcb6aa6780b93ce881 (diff)
downloadgit-64bc6e3db54ef9e2accfdb8e6c8168f789946fcb.zip
git-64bc6e3db54ef9e2accfdb8e6c8168f789946fcb.tar.gz
git-64bc6e3db54ef9e2accfdb8e6c8168f789946fcb.tar.bz2
setup_revisions(): handle -n<n> and -<n> internally.
This moves the handling of max-count shorthand from the internal implementation of "git log" to setup_revisions() so other users of setup_revisions() can use it. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git.c')
-rw-r--r--git.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/git.c b/git.c
index bf68dac..a547dbd 100644
--- a/git.c
+++ b/git.c
@@ -264,20 +264,7 @@ static int cmd_log(int argc, char **argv, char **envp)
argc = setup_revisions(argc, argv, &rev, "HEAD");
while (1 < argc) {
char *arg = argv[1];
- /* accept -<digit>, like traditilnal "head" */
- if ((*arg == '-') && isdigit(arg[1])) {
- rev.max_count = atoi(arg + 1);
- }
- else if (!strcmp(arg, "-n")) {
- if (argc < 2)
- die("-n requires an argument");
- rev.max_count = atoi(argv[2]);
- argc--; argv++;
- }
- else if (!strncmp(arg,"-n",2)) {
- rev.max_count = atoi(arg + 2);
- }
- else if (!strncmp(arg, "--pretty", 8)) {
+ if (!strncmp(arg, "--pretty", 8)) {
commit_format = get_commit_format(arg + 8);
if (commit_format == CMIT_FMT_ONELINE)
commit_prefix = "";