From: Nelson Elhage <hidden> Date: 2016-06-15 22:47:24
Oh, I see. I was reading builtin-reflog.c, which, in both
cmd_reflog_expire and cmd_reflog_delete, does check for -n as
synonymous to --dry-run:
if (!strcmp(arg, "--dry-run") || !strcmp(arg, "-n"))
cb.dry_run = 1;
but I missed that 'reflog show' aliases for git-log, and that that
accepts -n.
Patch withdrawn -- I'd send one documenting that -n works for delete
and expire, but it'd probably just complicate the documentation more
than clarify anything.
- Nelson
On Sun, Sep 13, 2009 at 05:40:32AM -0400, Jeff King wrote:
On Sat, Sep 12, 2009 at 11:41:54PM -0400, Nelson Elhage wrote:
Really? I think "git reflog show -n" is not about dry-run at all...
Indeed. However, the reflog expire uses -n as an alias for --dry-run,
according to lines 548-549 of my builtin-reflog.c (ddfdf5a):
if (!strcmp(arg, "--dry-run") || !strcmp(arg, "-n"))
cb.dry_run = 1;
...and this usage-string is only output from cmd_reflog_expire, so the
correct solution would IMO be to simply remove show from the
usage-string:
-"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix]
[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...";
+"git reflog expire [--verbose] [-n | --dry-run] [--stale-fix]
[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...";
This issue ("reflog expire" incorrectly documenting "reflog show") was
present before this patch, though. At least the option "--stale-fix"
appears not to be valid for "reflog show".
--
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656
From: Jeff King <hidden> Date: 2016-06-15 22:47:24
On Sun, Sep 13, 2009 at 08:53:13AM -0400, Nelson Elhage wrote:
Patch withdrawn -- I'd send one documenting that -n works for delete
and expire, but it'd probably just complicate the documentation more
than clarify anything.
I think it would be fine to just split the (show|expire) line into two
separate lines: