git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] reflog documentation: -n is an alias for --dry-run

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Sep 13, 2009, 13:05 UTC
Message-ID
<40aa078e0909130605s5b445fdclb22147ce070d0581@mail.gmail.com>
In-Reply-To
<20090913094032.GC14438@coredump.intra.peff.net>
On Sun, Sep 13, 2009 at 11:40 AM, Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
>>  static const char reflog_expire_usage[] =
>> -"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...";
>> +"git reflog (show|expire) [--verbose] [-n | --dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...";
>
> 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
Previous: Jeff King
Message 5 of 5 in “reflog documentation: -n is an alias for --dry-run”
  1. reflog documentation: -n is an alias for --dry-runNelson Elhage, Sep 13, 2009
  2. Jeff KingSep 13, 2009
  3. Nelson ElhageSep 13, 2009
  4. Jeff KingSep 13, 2009
  5. Erik Faye-LundSep 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.