diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-04-10 08:25:44 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-04-10 08:25:44 +0900 |
| commit | 78c20b8fcaf0c46942a8c91e38076358f9a948ac (patch) | |
| tree | 9f172fdddeacc813299e63bcfa3d778151e9e133 /builtin/shortlog.c | |
| parent | Merge branch 'ab/install-symlinks' (diff) | |
| parent | shortlog: disallow left-over arguments outside repo (diff) | |
| download | git-78c20b8fcaf0c46942a8c91e38076358f9a948ac.tar.gz git-78c20b8fcaf0c46942a8c91e38076358f9a948ac.zip | |
Merge branch 'ma/shortlog-revparse'
"git shortlog cruft" aborted with a BUG message when run outside a
Git repository. The command has been taught to complain about
extra and unwanted arguments on its command line instead in such a
case.
* ma/shortlog-revparse:
shortlog: disallow left-over arguments outside repo
shortlog: add usage-string for stdin-reading
git-shortlog.txt: reorder usages
Diffstat (limited to 'builtin/shortlog.c')
| -rw-r--r-- | builtin/shortlog.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/shortlog.c b/builtin/shortlog.c index e29875b843..3a823b3128 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -11,7 +11,8 @@ #include "parse-options.h" static char const * const shortlog_usage[] = { - N_("git shortlog [<options>] [<revision-range>] [[--] [<path>...]]"), + N_("git shortlog [<options>] [<revision-range>] [[--] <path>...]"), + N_("git log --pretty=short | git shortlog [<options>]"), NULL }; @@ -292,6 +293,11 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) parse_done: argc = parse_options_end(&ctx); + if (nongit && argc > 1) { + error(_("too many arguments given outside repository")); + usage_with_options(shortlog_usage, options); + } + if (setup_revisions(argc, argv, &rev, NULL) != 1) { error(_("unrecognized argument: %s"), argv[1]); usage_with_options(shortlog_usage, options); |
