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

Re: possible usability issue in rebase -i?

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Oct 27, 2009, 15:50 UTC
Message-ID
<40aa078e0910270850u6ffec41cj372da11d9df533f@mail.gmail.com>
In-Reply-To
<2faad3050910270817l71394722nda55265ed96722df@mail.gmail.com>
On Tue, Oct 27, 2009 at 4:17 PM, Baz <brian.ewins@gmail.com> wrote:
Show 29 quoted lines
> I've got a somewhat related minor usability issue with rebase -i. I
> accidentally typed something like 'git rebase -i -z' and got this
> message:
>
> error: unknown switch `z'
> usage: git-rebase [-i] [options] [--] <upstream> [<branch>]
>   or: git-rebase [-i] (--continue | --abort | --skip)
>
> Available options are
>    -v, --verbose         display a diffstat of what changed upstream
>    --onto ...            rebase onto given branch instead of upstream
>    -p, --preserve-merges
>                          try to recreate merges instead of ignoring them
>    -s, --strategy ...    use the given merge strategy
>    -m, --merge           always used (no-op)
>    -i, --interactive     always used (no-op)
>
> The last two lines were the surprise. It suggested to me that '-i' and
> '-m' were now the defaults for git-rebase - which of course they're
> not. A user would not know that this is actually reporting the flags
> that work for git-rebase--interactive, especially since that's not
> what the command calls itself. I wasn't sure about the best approach
> to fixing this - the only comparable commands that pass arbitrary
> flags down to an exec'd program make it clear what program is going to
> be called (usually git merge) and so interpreting errors is easier.
>
> It seems the intent here was to signal that the flags are different
> once a rebase is in progress, but this usage message is shown when
> rebase -i -z is called in any state.

If that is the case, my instinct tells me that this information should be reflected in the usage-string (instead of the parameter description). Something like this?

--->8---
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 23ded48..3ed5f94 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -13,15 +13,15 @@
 OPTIONS_KEEPDASHDASH=
 OPTIONS_SPEC="\
 git-rebase [-i] [options] [--] <upstream> [<branch>]
-git-rebase [-i] (--continue | --abort | --skip)
+git-rebase [-i] [-m] (--continue | --abort | --skip)
 --
  Available options are
 v,verbose          display a diffstat of what changed upstream
 onto=              rebase onto given branch instead of upstream
 p,preserve-merges  try to recreate merges instead of ignoring them
 s,strategy=        use the given merge strategy
-m,merge            always used (no-op)
-i,interactive      always used (no-op)
+m,merge            use merging strategies
+i,interactive      interactively edit commits
  Actions:
 continue           continue rebasing process
 abort              abort rebasing process and restore original branch
-- 
Erik "kusma" Faye-Lund
Previous: BazNext: Baz
Message 8 of 12 in “possible usability issue in rebase -i?”
  1. Erik Faye-LundOct 27, 2009
  2. rebase -i: more graceful handling of invalid commandsJan Krüger, Oct 27, 2009
  3. Johannes SchindelinOct 27, 2009
  4. Thomas RastOct 27, 2009
  5. rebase -i: more graceful handling of invalid commandsJan Krüger, Oct 27, 2009
  6. Junio C HamanoOct 28, 2009
  7. BazOct 27, 2009
  8. Erik Faye-LundOct 27, 2009
  9. BazOct 27, 2009
  10. Erik Faye-LundOct 28, 2009
  11. BazOct 28, 2009
  12. Erik Faye-LundOct 28, 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.