Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-21 10:44:52 +0300
committerJunio C Hamano <gitster@pobox.com>2009-11-21 10:44:52 +0300
commit750054cd3f1298bc9e113a47eaa6346923e08c19 (patch)
tree2a1f04ed14b6a705723c2832939d50b302252625 /builtin-log.c
parent1b8dbdb41e503f6829be4e1d8ada4c8eabbc49bd (diff)
parentd74bb308fa9e49e0a5b9a0792e6079bbc0c8aea8 (diff)
Merge branch 'jn/help-everywhere'
* jn/help-everywhere: (23 commits) diff --no-index: make the usage string less scary merge-{recursive,subtree}: use usagef() to print usage Introduce usagef() that takes a printf-style format Let 'git <command> -h' show usage without a git dir Show usage string for 'git http-push -h' Let 'git http-fetch -h' show usage outside any git repository Show usage string for 'git stripspace -h' Show usage string for 'git unpack-file -h' Show usage string for 'git show-index -h' Show usage string for 'git rev-parse -h' Show usage string for 'git merge-one-file -h' Show usage string for 'git mailsplit -h' Show usage string for 'git imap-send -h' Show usage string for 'git get-tar-commit-id -h' Show usage string for 'git fast-import -h' Show usage string for 'git check-ref-format -h' http-fetch: add missing initialization of argv0_path Show usage string for 'git show-ref -h' Show usage string for 'git merge-ours -h' Show usage string for 'git commit-tree -h' ... Conflicts: imap-send.c
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin-log.c b/builtin-log.c
index fb5308220d..ef5b3c3ae3 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -50,6 +50,12 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
if (default_date_mode)
rev->date_mode = parse_date_format(default_date_mode);
+ /*
+ * Check for -h before setup_revisions(), or "git log -h" will
+ * fail when run without a git directory.
+ */
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage(builtin_log_usage);
argc = setup_revisions(argc, argv, rev, "HEAD");
if (rev->diffopt.pickaxe || rev->diffopt.filter)
@@ -1242,6 +1248,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
argv++;
}
+ if (argc > 1 && !strcmp(argv[1], "-h"))
+ usage(cherry_usage);
+
switch (argc) {
case 4:
limit = argv[3];