X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=revision.c;h=a3df8100763136e8936b8e3b4c647d5b83cc7239;hb=fe041ad68d02d3c117c68f9bd3d37cd80208f31d;hp=c84f14609be4a2ef359eb472d29bc527fad9b680;hpb=765ac8ec469f110e88376e4fac05d0ed475bcb28;p=git.git diff --git a/revision.c b/revision.c index c84f1460..a3df8100 100644 --- a/revision.c +++ b/revision.c @@ -482,6 +482,21 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch revs->max_count = atoi(arg + 12); continue; } + /* accept -, like traditilnal "head" */ + if ((*arg == '-') && isdigit(arg[1])) { + revs->max_count = atoi(arg + 1); + continue; + } + if (!strcmp(arg, "-n")) { + if (argc <= i + 1) + die("-n requires an argument"); + revs->max_count = atoi(argv[++i]); + continue; + } + if (!strncmp(arg,"-n",2)) { + revs->max_count = atoi(arg + 2); + continue; + } if (!strncmp(arg, "--max-age=", 10)) { revs->max_age = atoi(arg + 10); revs->limited = 1; @@ -492,6 +507,26 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch revs->limited = 1; continue; } + if (!strncmp(arg, "--since=", 8)) { + revs->max_age = approxidate(arg + 8); + revs->limited = 1; + continue; + } + if (!strncmp(arg, "--after=", 8)) { + revs->max_age = approxidate(arg + 8); + revs->limited = 1; + continue; + } + if (!strncmp(arg, "--before=", 9)) { + revs->min_age = approxidate(arg + 9); + revs->limited = 1; + continue; + } + if (!strncmp(arg, "--until=", 8)) { + revs->min_age = approxidate(arg + 8); + revs->limited = 1; + continue; + } if (!strcmp(arg, "--all")) { handle_all(revs, flags); continue;