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

Re: [PATCH] git-rebase -i: improve usage message

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 29, 2009, 06:24 UTC
Message-ID
<7vtyxiafa9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1256774549-8191-1-git-send-email-brian.ewins@gmail.com>
Brian Ewins <brian.ewins@gmail.com> writes:
Show 5 quoted lines
> The usage message was confusing as it implied that interactive
> mode was optional but the default. Change the message to more
> appropriately report usage when the -i flag is supplied.
> In addition, use the same division into 3 command formats as
> the man page.

I agree; if "git rebase--interactive -h" were asked, "-i is always used" might be a correct thing to say, but nobody will get the message that way. Instead, "git rebase --nonsense -i" and "git rebase -i --nonsense" will be the most common way for users to see the message (also "git rebase -i -h").

The OPTIONS_SPEC in rebase--interactive is for the interactive mode and for nothing else, so it may be a good idea to clearly say so at the beginning. The user experience perhaps should look like:

    $ git rebase -i -h
    Note: this help is only about the interactive mode;
    see 'git rebase -h' for help on non-interactive mode.
    usage: git rebase -i [<options>] [--] <upstream> [<branch>]
       or: git rebase -i (--continue|--abort|--skip)
    Available options are
    -v,--verbose          verbose output
    --onto <commit>       rebase onto given commit instead of <upstream>
    -p,--preserve-merges  try to recreate merges
    -i,--interactive      (always in effect in interactive mode)
    -m,--merge            (always in effect in interactive mode)
    Actions:
        --continue        continue the interrupted rebase session
        ...

By the way, I think the main "git rebase" help should be improved first for this improvement to make sense.

 * Its first line "usage" is too long;
 * It only mentions [-i] in the first line but does not hint that the
   detailed help on interactive mode is available with "rebase -i -h".
The user experience perhaps should look like this:
    $ git rebase -h
    usage: git rebase [<options>] (<upstream>|--root) [<branch>]
    -i,--interactive  go interactive (see 'git rebase -i -h')
    -v,--verbose      verbose output
    ...
Also see
  http://thread.gmane.org/gmane.comp.version-control.git/129906/focus=130646

I agree with Peff that the first-line usage should just say <options> in general and have a table of options and their descriptions.

Previous: Brian EwinsNext: Thomas Rast
Message 2 of 3 in “git-rebase -i: improve usage message”
  1. git-rebase -i: improve usage messageBrian Ewins, Oct 29, 2009
  2. Junio C HamanoOct 29, 2009
  3. Thomas RastOct 29, 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.