@@ -1996,6 +1996,9 @@ static void make_rev_options(struct rev_info *revs)
OPT_REV('n', "max-count", N_("<n>"),
N_("limit the number of commis to stdout"),
rev_opt_max_count),
+ OPT_INTEGER_F(0, "skip", &revs->skip_count,
+ N_("skip a number of commits before starting to show"),
+ PARSE_OPT_NONEG),
OPT_END(),
};
revs->options = parse_options_concat(options, revs->diffopt.parseopts);
@@ -2036,10 +2039,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
if (argc)
return argc;
- if ((argcount = parse_long_opt("skip", argv, &optarg))) {
- revs->skip_count = atoi(optarg);
- return argcount;
- } else if ((*arg == '-') && isdigit(arg[1])) {
+ if ((*arg == '-') && isdigit(arg[1])) {
/* accept -<digit>, like traditional "head" */
if (strtol_i(arg + 1, 10, &revs->max_count) < 0 ||
revs->max_count < 0)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> --- revision.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)