{"thread":{"id":"20433","subject":"[PATCH] Show usage string for 'git log -h', 'git show -h' and 'git diff -h'","startedAt":"2009-08-06T10:47:21Z","lastAt":"2009-08-06T10:47:21Z","messageCount":1,"participants":["Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"119771","messageId":"1249555641-342-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"20433","inReplyTo":null,"subject":"[PATCH] Show usage string for 'git log -h', 'git show -h' and 'git diff -h'","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-08-06T10:47:21Z","receivedAt":"2009-08-06T10:47:21Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin-diff.c |    2 ++\n builtin-log.c  |    6 ++++++\n 2 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-diff.c b/builtin-diff.c\nindex 2e51f40..ffcdd05 100644\n--- a/builtin-diff.c\n+++ b/builtin-diff.c\n@@ -218,6 +218,8 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv\n \t\t\trevs->max_count = 3;\n \t\telse if (!strcmp(argv[1], \"-q\"))\n \t\t\toptions |= DIFF_SILENT_ON_REMOVED;\n+\t\telse if (!strcmp(argv[1], \"-h\"))\n+\t\t\tusage(builtin_diff_usage);\n \t\telse\n \t\t\treturn error(\"invalid option: %s\", argv[1]);\n \t\targv++; argc--;\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 3035816..3817bf1 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -27,6 +27,10 @@ static int default_show_root = 1;\n static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_pretty;\n \n+static const char * const builtin_log_usage =\n+\t\"git log [<options>] [<since>..<until>] [[--] <path>...]\\n\"\n+\t\"   or: git show [options] <object>...\";\n+\n static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t      struct rev_info *rev)\n {\n@@ -61,6 +65,8 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t\trev->show_decorations = 1;\n \t\t} else if (!strcmp(arg, \"--source\")) {\n \t\t\trev->show_source = 1;\n+\t\t} else if (!strcmp(arg, \"-h\")) {\n+\t\t\tusage(builtin_log_usage);\n \t\t} else\n \t\t\tdie(\"unrecognized argument: %s\", arg);\n \t}\n-- \n1.6.4.55.gc63c6.dirty\n"}]}