X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=rev-parse.c;h=169d0cc9b5a5769ad90e1f76039f14bf051a39dc;hb=211b5f9e62cc961acda59392fbf5a3efa8106c97;hp=507b531dce781133946da04cb27fa2ff6d3832a9;hpb=c1067050ce58b5b39f528fe634732da858664603;p=git.git diff --git a/rev-parse.c b/rev-parse.c index 507b531d..169d0cc9 100644 --- a/rev-parse.c +++ b/rev-parse.c @@ -32,6 +32,7 @@ static int revs_count = 0; static int is_rev_argument(const char *arg) { static const char *rev_args[] = { + "--all", "--bisect", "--header", "--max-age=", @@ -150,6 +151,13 @@ static void show_datestring(const char *flag, const char *datestr) show(buffer); } +static void show_file(const char *arg) +{ + show_default(); + if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV)) + show(arg); +} + int main(int argc, char **argv) { int i, as_is = 0, verify = 0; @@ -161,12 +169,15 @@ int main(int argc, char **argv) char *dotdot; if (as_is) { - show(arg); + show_file(arg); continue; } if (*arg == '-') { if (!strcmp(arg, "--")) { as_is = 1; + /* Pass on the "--" if we show anything but files.. */ + if (filter & (DO_FLAGS | DO_REVS)) + show_file(arg); continue; } if (!strcmp(arg, "--default")) { @@ -281,9 +292,8 @@ int main(int argc, char **argv) } if (verify) die("Needed a single revision"); - if ((filter & (DO_NONFLAGS|DO_NOREV)) == - (DO_NONFLAGS|DO_NOREV)) - show(arg); + as_is = 1; + show_file(arg); } show_default(); if (verify && revs_count != 1)