path: root/builtin/rev-list.c
diff options
authorJunio C Hamano <>2017-06-19 19:38:45 (GMT)
committerJunio C Hamano <>2017-06-19 19:38:45 (GMT)
commit50ad8561dee9d479e41586689486cbbb4a742f7b (patch)
tree41687648bc7b1674a109fdeb490b9b749f458fde /builtin/rev-list.c
parent06959fe0e1f50608ff872be386a7c53d97f885f4 (diff)
parentd691551192ac845747694258ccae9ffeeb6bdd58 (diff)
Merge branch 'jk/consistent-h'
"git $cmd -h" for builtin commands calls the implementation of the command (i.e. cmd_$cmd() function) without doing any repository set-up, and the commands that expect RUN_SETUP is done by the Git potty needs to be prepared to show the help text without barfing. * jk/consistent-h: t0012: test "-h" with builtins git: add hidden --list-builtins option version: convert to parse-options diff- and log- family: handle "git cmd -h" early submodule--helper: show usage for "-h" remote-{ext,fd}: print usage message on invalid arguments upload-archive: handle "-h" option early credential: handle invalid arguments earlier
Diffstat (limited to 'builtin/rev-list.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 718c605..b250c51 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -277,6 +277,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
int use_bitmap_index = 0;
const char *show_progress = NULL;
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage(rev_list_usage);
git_config(git_default_config, NULL);
init_revisions(&revs, prefix);
revs.abbrev = DEFAULT_ABBREV;