{"thread":{"id":"20924","subject":"[PATCH] reflog documentation: -n is an alias for --dry-run","startedAt":"2009-09-13T03:41:54Z","lastAt":"2009-09-13T13:26:14Z","messageCount":5,"participants":["Nelson Elhage","Jeff King","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"123026","messageId":"1252813314-14408-1-git-send-email-nelhage@mit.edu","threadId":"20924","inReplyTo":null,"subject":"[PATCH] reflog documentation: -n is an alias for --dry-run","fromName":"Nelson Elhage","fromEmail":"nelhage@mit.edu","sentAt":"2009-09-13T03:41:54Z","receivedAt":"2009-09-13T03:41:54Z","isPatch":true,"sender":{"key":"nelhage@mit.edu","avatar":"https://avatars.githubusercontent.com/u/16725?v=4"},"body":"Signed-off-by: Nelson Elhage <nelhage@mit.edu>\n---\n Documentation/git-reflog.txt |    2 +-\n builtin-reflog.c             |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt\nindex 7f7a544..b434ff7 100644\n--- a/Documentation/git-reflog.txt\n+++ b/Documentation/git-reflog.txt\n@@ -16,7 +16,7 @@ The command takes various subcommands, and different options\n depending on the subcommand:\n \n [verse]\n-'git reflog expire' [--dry-run] [--stale-fix] [--verbose]\n+'git reflog expire' [-n | --dry-run] [--stale-fix] [--verbose]\n \t[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\n +\n 'git reflog delete' ref@\\{specifier\\}...\ndiff --git a/builtin-reflog.c b/builtin-reflog.c\nindex 95198c5..f37c57b 100644\n--- a/builtin-reflog.c\n+++ b/builtin-reflog.c\n@@ -13,9 +13,9 @@\n  */\n \n static const char reflog_expire_usage[] =\n-\"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n+\"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n static const char reflog_delete_usage[] =\n-\"git reflog delete [--verbose] [--dry-run] [--rewrite] [--updateref] <refs>...\";\n+\"git reflog delete [--verbose] [-n | --dry-run] [--rewrite] [--updateref] <refs>...\";\n \n static unsigned long default_reflog_expire;\n static unsigned long default_reflog_expire_unreachable;\n-- \n1.6.3.1.499.ge7b8da\n"},{"id":"123042","messageId":"20090913094032.GC14438@coredump.intra.peff.net","threadId":"20924","inReplyTo":"1252813314-14408-1-git-send-email-nelhage@mit.edu","subject":"Re: [PATCH] reflog documentation: -n is an alias for --dry-run","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-09-13T09:40:32Z","receivedAt":"2009-09-13T09:40:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 12, 2009 at 11:41:54PM -0400, Nelson Elhage wrote:\n\n>  static const char reflog_expire_usage[] =\n> -\"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n> +\"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n\nReally? I think \"git reflog show -n\" is not about dry-run at all...\n\n-Peff\n"},{"id":"123052","messageId":"20090913125313.GQ4275@mit.edu","threadId":"20924","inReplyTo":"20090913094032.GC14438@coredump.intra.peff.net","subject":"Re: [PATCH] reflog documentation: -n is an alias for --dry-run","fromName":"Nelson Elhage","fromEmail":"nelhage@mit.edu","sentAt":"2009-09-13T12:53:13Z","receivedAt":"2009-09-13T12:53:13Z","isPatch":true,"sender":{"key":"nelhage@mit.edu","avatar":"https://avatars.githubusercontent.com/u/16725?v=4"},"body":"Oh, I see. I was reading builtin-reflog.c, which, in both\ncmd_reflog_expire and cmd_reflog_delete, does check for -n as\nsynonymous to --dry-run:\n\nif (!strcmp(arg, \"--dry-run\") || !strcmp(arg, \"-n\"))\n    cb.dry_run = 1;\n\nbut I missed that 'reflog show' aliases for git-log, and that that\naccepts -n.\n\nPatch withdrawn -- I'd send one documenting that -n works for delete\nand expire, but it'd probably just complicate the documentation more\nthan clarify anything.\n\n- Nelson\n\nOn Sun, Sep 13, 2009 at 05:40:32AM -0400, Jeff King wrote:\n> On Sat, Sep 12, 2009 at 11:41:54PM -0400, Nelson Elhage wrote:\n> \n> >  static const char reflog_expire_usage[] =\n> > -\"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n> > +\"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n> \n> Really? I think \"git reflog show -n\" is not about dry-run at all...\n> \n> -Peff\n"},{"id":"123053","messageId":"40aa078e0909130605s5b445fdclb22147ce070d0581@mail.gmail.com","threadId":"20924","inReplyTo":"20090913094032.GC14438@coredump.intra.peff.net","subject":"Re: [PATCH] reflog documentation: -n is an alias for --dry-run","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2009-09-13T13:05:04Z","receivedAt":"2009-09-13T13:05:04Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sun, Sep 13, 2009 at 11:40 AM, Jeff King <peff@peff.net> wrote:\n>>  static const char reflog_expire_usage[] =\n>> -\"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n>> +\"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n>\n> Really? I think \"git reflog show -n\" is not about dry-run at all...\n\nIndeed. However, the reflog expire uses -n as an alias for --dry-run,\naccording to lines 548-549 of my builtin-reflog.c (ddfdf5a):\n\n\t\tif (!strcmp(arg, \"--dry-run\") || !strcmp(arg, \"-n\"))\n\t\t\tcb.dry_run = 1;\n\n...and this usage-string is only output from cmd_reflog_expire, so the\ncorrect solution would IMO be to simply remove show from the\nusage-string:\n\n-\"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix]\n[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n+\"git reflog expire [--verbose] [-n | --dry-run] [--stale-fix]\n[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n\nThis issue (\"reflog expire\" incorrectly documenting \"reflog show\") was\npresent before this patch, though. At least the option \"--stale-fix\"\nappears not to be valid for \"reflog show\".\n\n-- \nErik \"kusma\" Faye-Lund\nkusmabite@gmail.com\n(+47) 986 59 656\n"},{"id":"123055","messageId":"20090913132614.GA26275@coredump.intra.peff.net","threadId":"20924","inReplyTo":"20090913125313.GQ4275@mit.edu","subject":"Re: [PATCH] reflog documentation: -n is an alias for --dry-run","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-09-13T13:26:14Z","receivedAt":"2009-09-13T13:26:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Sep 13, 2009 at 08:53:13AM -0400, Nelson Elhage wrote:\n\n> Patch withdrawn -- I'd send one documenting that -n works for delete\n> and expire, but it'd probably just complicate the documentation more\n> than clarify anything.\n\nI think it would be fine to just split the (show|expire) line into two\nseparate lines:\n\n> > > -\"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n> > > +\"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...\";\n\n-Peff\n"}]}