{"thread":{"id":"27051","subject":"[PATCH] revert: Hide '-r' option in default usage","startedAt":"2011-04-10T15:39:14Z","lastAt":"2011-04-13T18:09:56Z","messageCount":4,"participants":["Ramkumar Ramachandra","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"165560","messageId":"1302449954-15353-1-git-send-email-artagnon@gmail.com","threadId":"27051","inReplyTo":null,"subject":"[PATCH] revert: Hide '-r' option in default usage","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2011-04-10T15:39:14Z","receivedAt":"2011-04-10T15:39:14Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Since the '-r' command-line option is a no-op provided only for\nbackward compatiblity, don't advertise it in the default usage.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\nThis is a minor detail I noticed while working on the sequencer.\n\n builtin/revert.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 2bb13eb..f697e66 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -76,7 +76,8 @@ static void parse_args(int argc, const char **argv)\n \tstruct option options[] = {\n \t\tOPT_BOOLEAN('n', \"no-commit\", &no_commit, \"don't automatically commit\"),\n \t\tOPT_BOOLEAN('e', \"edit\", &edit, \"edit the commit message\"),\n-\t\tOPT_BOOLEAN('r', NULL, &noop, \"no-op (backward compatibility)\"),\n+\t\t{ OPTION_BOOLEAN, 'r', NULL, &noop, NULL, \"no-op (backward compatibility)\",\n+\t\t  PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },\n \t\tOPT_BOOLEAN('s', \"signoff\", &signoff, \"add Signed-off-by:\"),\n \t\tOPT_INTEGER('m', \"mainline\", &mainline, \"parent number\"),\n \t\tOPT_RERERE_AUTOUPDATE(&allow_rerere_auto),\n-- \n1.7.4.rc1.7.g2cf08.dirty\n"},{"id":"165649","messageId":"7vhba4v6p8.fsf@alter.siamese.dyndns.org","threadId":"27051","inReplyTo":"1302449954-15353-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] revert: Hide '-r' option in default usage","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-11T21:06:27Z","receivedAt":"2011-04-11T21:06:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Since the '-r' command-line option is a no-op provided only for\n> backward compatiblity, don't advertise it in the default usage.\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n\nThanks.\n\nIt would have saved me a lot of time if you wrote that this option has\nbeen a no-op since abd6970 (cherry-pick: make -r the default, 2006-10-05),\nbut the commit didn't remove it from the usage string, and it somehow\nsurvived 9509af6 (Make git-revert & git-cherry-pick a builtin, 2007-03-01)\nand later f810379 (Make builtin-revert.c use parse_options, 2007-10-07),\nand it is about time to stop advertising it.\n\n> This is a minor detail I noticed while working on the sequencer.\n>\n>  builtin/revert.c |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/builtin/revert.c b/builtin/revert.c\n> index 2bb13eb..f697e66 100644\n> --- a/builtin/revert.c\n> +++ b/builtin/revert.c\n> @@ -76,7 +76,8 @@ static void parse_args(int argc, const char **argv)\n>  \tstruct option options[] = {\n>  \t\tOPT_BOOLEAN('n', \"no-commit\", &no_commit, \"don't automatically commit\"),\n>  \t\tOPT_BOOLEAN('e', \"edit\", &edit, \"edit the commit message\"),\n> -\t\tOPT_BOOLEAN('r', NULL, &noop, \"no-op (backward compatibility)\"),\n> +\t\t{ OPTION_BOOLEAN, 'r', NULL, &noop, NULL, \"no-op (backward compatibility)\",\n> +\t\t  PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },\n>  \t\tOPT_BOOLEAN('s', \"signoff\", &signoff, \"add Signed-off-by:\"),\n>  \t\tOPT_INTEGER('m', \"mainline\", &mainline, \"parent number\"),\n>  \t\tOPT_RERERE_AUTOUPDATE(&allow_rerere_auto),\n"},{"id":"165749","messageId":"20110413132146.GB26760@kytes","threadId":"27051","inReplyTo":"7vhba4v6p8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] revert: Hide '-r' option in default usage","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2011-04-13T13:21:49Z","receivedAt":"2011-04-13T13:21:49Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi Junio,\n\nJunio C Hamano writes:\n> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n> \n> > Since the '-r' command-line option is a no-op provided only for\n> > backward compatiblity, don't advertise it in the default usage.\n> >\n> > Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> > ---\n> \n> Thanks.\n> \n> It would have saved me a lot of time if you wrote that this option has\n> been a no-op since abd6970 (cherry-pick: make -r the default, 2006-10-05),\n> but the commit didn't remove it from the usage string, and it somehow\n> survived 9509af6 (Make git-revert & git-cherry-pick a builtin, 2007-03-01)\n> and later f810379 (Make builtin-revert.c use parse_options, 2007-10-07),\n> and it is about time to stop advertising it.\n\nThanks.  I didn't realize there was so much history to write about.\nHas you queued this somewhere?\n\n-- Ram\n"},{"id":"165760","messageId":"7vhba2m39n.fsf@alter.siamese.dyndns.org","threadId":"27051","inReplyTo":"20110413132146.GB26760@kytes","subject":"Re: [PATCH] revert: Hide '-r' option in default usage","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-13T18:09:56Z","receivedAt":"2011-04-13T18:09:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Hi Junio,\n>\n> Junio C Hamano writes:\n>> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n>> \n>> > Since the '-r' command-line option is a no-op provided only for\n>> > backward compatiblity, don't advertise it in the default usage.\n>> >\n>> > Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n>> > ---\n>> \n>> Thanks.\n>> \n>> It would have saved me a lot of time if you wrote that this option has\n>> been a no-op since abd6970 (cherry-pick: make -r the default, 2006-10-05),\n>> but the commit didn't remove it from the usage string, and it somehow\n>> survived 9509af6 (Make git-revert & git-cherry-pick a builtin, 2007-03-01)\n>> and later f810379 (Make builtin-revert.c use parse_options, 2007-10-07),\n>> and it is about time to stop advertising it.\n>\n> Thanks.  I didn't realize there was so much history to write about.\n\nNot necessarily in the final commit message; before \"---\" would have been\nsufficient.\n\n> Has you queued this somewhere?\n\nSorry, after spending time to dig the history to see when we made this a\nno-op to ensure that it was sufficiently long time ago and wrote my\nfinding in the message to you, I forgot to apply the patch.  Will queue.\n\nThanks.\n"}]}