{"thread":{"id":"48061","subject":"[GSoC] parse: not show usage help when invalid id","startedAt":"2018-03-16T22:33:56Z","lastAt":"2018-03-16T23:05:22Z","messageCount":2,"participants":["Roger Solano","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"341959","messageId":"20180316223345.7799-1-sc_rogeralberto@hotmail.com","threadId":"48061","inReplyTo":null,"subject":"[GSoC] parse: not show usage help when invalid id","fromName":"Roger Solano","fromEmail":"sroger.git@gmail.com","sentAt":"2018-03-16T22:33:45Z","receivedAt":"2018-03-16T22:33:56Z","isPatch":false,"sender":{"key":"sroger.git@gmail.com","avatar":null},"body":"patch for too chatty command when <id> is invalid\nex. git tag --contains <id>\n\nIt is possible to skip 'goto show_usage_error' when\nparse_long_opt fails? and return directly from there.\n\nSigned-off-by: Roger Solano <sc_rogeralberto@hotmail.com>\n---\n parse-options.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/parse-options.c b/parse-options.c\nindex 125e84f98..074915eb3 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -550,7 +550,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,\n \t\t\tgoto show_usage;\n \t\tswitch (parse_long_opt(ctx, arg + 2, options)) {\n \t\tcase -1:\n-\t\t\tgoto show_usage_error;\n+\t\t\treturn -1; \n \t\tcase -2:\n \t\t\tgoto unknown;\n \t\t}\n-- \n2.13.6\n\n"},{"id":"341965","messageId":"xmqq605vzknz.fsf@gitster-ct.c.googlers.com","threadId":"48061","inReplyTo":"20180316223345.7799-1-sc_rogeralberto@hotmail.com","subject":"Re: [GSoC] parse: not show usage help when invalid id","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-16T23:05:04Z","receivedAt":"2018-03-16T23:05:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Roger Solano <sroger.git@gmail.com> writes:\n\n> patch for too chatty command when <id> is invalid\n> ex. git tag --contains <id>\n>\n> It is possible to skip 'goto show_usage_error' when\n> parse_long_opt fails? and return directly from there.\n\nCan you explain how this relates to and/or compares with a recent\nupdate [1]?\n\nThanks.\n\n[1] https://public-inbox.org/git/20180306193116.23876-1-ungureanupaulsebastian@gmail.com\n\n>\n> Signed-off-by: Roger Solano <sc_rogeralberto@hotmail.com>\n> ---\n>  parse-options.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/parse-options.c b/parse-options.c\n> index 125e84f98..074915eb3 100644\n> --- a/parse-options.c\n> +++ b/parse-options.c\n> @@ -550,7 +550,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,\n>  \t\t\tgoto show_usage;\n>  \t\tswitch (parse_long_opt(ctx, arg + 2, options)) {\n>  \t\tcase -1:\n> -\t\t\tgoto show_usage_error;\n> +\t\t\treturn -1; \n>  \t\tcase -2:\n>  \t\t\tgoto unknown;\n>  \t\t}\n"}]}