{"thread":{"id":"32988","subject":"[PATCH] update-index: allow \"-h\" to also display options","startedAt":"2013-02-23T18:10:41Z","lastAt":"2013-02-23T21:25:08Z","messageCount":3,"participants":["Antoine Pelisse","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"210096","messageId":"1361643041-19036-1-git-send-email-apelisse@gmail.com","threadId":"32988","inReplyTo":null,"subject":"[PATCH] update-index: allow \"-h\" to also display options","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-02-23T18:10:41Z","receivedAt":"2013-02-23T18:10:41Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"Currently, when running \"git update-index -h\", you only have usage\ndisplayed, but no options. That is not consistent with the behavior of\nother commands. It also means that the only way to display options is to\nuse an unknown argument (or use the man page).\n\nDisplay usage with options when \"git update-index -h\" is invoked.\n\nSigned-off-by: Antoine Pelisse <apelisse@gmail.com>\n---\n builtin/update-index.c |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex ada1dff..3071ee6 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t};\n \n \tif (argc == 2 && !strcmp(argv[1], \"-h\"))\n-\t\tusage(update_index_usage[0]);\n+\t\tusage_with_options(&update_index_usage[0], options);\n \n \tgit_config(git_default_config, NULL);\n \n-- \n1.7.9.5\n"},{"id":"210097","messageId":"CALWbr2x4En9qof7hFL+Onh1M1080=-OaJtAsNYY01qRj5R1a1w@mail.gmail.com","threadId":"32988","inReplyTo":"1361643041-19036-1-git-send-email-apelisse@gmail.com","subject":"Re: [PATCH] update-index: allow \"-h\" to also display options","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-02-23T18:13:15Z","receivedAt":"2013-02-23T18:13:15Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"> diff --git a/builtin/update-index.c b/builtin/update-index.c\n> index ada1dff..3071ee6 100644\n> --- a/builtin/update-index.c\n> +++ b/builtin/update-index.c\n> @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n>         };\n>\n>         if (argc == 2 && !strcmp(argv[1], \"-h\"))\n> -               usage(update_index_usage[0]);\n> +               usage_with_options(&update_index_usage[0], options);\n>\n>         git_config(git_default_config, NULL);\n>\n\nOk I just realized that\n\n    usage_with_options(update_index_usage, options);\n\nwould be better...\n\nAntoine,\n"},{"id":"210109","messageId":"7vfw0m7mff.fsf@alter.siamese.dyndns.org","threadId":"32988","inReplyTo":"CALWbr2x4En9qof7hFL+Onh1M1080=-OaJtAsNYY01qRj5R1a1w@mail.gmail.com","subject":"Re: [PATCH] update-index: allow \"-h\" to also display options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-23T21:25:08Z","receivedAt":"2013-02-23T21:25:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Antoine Pelisse <apelisse@gmail.com> writes:\n\n>> diff --git a/builtin/update-index.c b/builtin/update-index.c\n>> index ada1dff..3071ee6 100644\n>> --- a/builtin/update-index.c\n>> +++ b/builtin/update-index.c\n>> @@ -796,7 +796,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n>>         };\n>>\n>>         if (argc == 2 && !strcmp(argv[1], \"-h\"))\n>> -               usage(update_index_usage[0]);\n>> +               usage_with_options(&update_index_usage[0], options);\n>>\n>>         git_config(git_default_config, NULL);\n>>\n>\n> Ok I just realized that\n>\n>     usage_with_options(update_index_usage, options);\n>\n> would be better...\n\nYeah, that probably is easier on the eyes, even though they are\nequivalent.\n\nThanks, will queue.\n"}]}