chiark / gitweb /
git-debrebase: Fix error message for wrong use of -i
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Feb 2020 10:25:07 +0000 (10:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 22 Jun 2020 18:04:08 +0000 (19:04 +0100)
Getopt::Long with "i:s" parses "-i something" as "-i" with a value of
"something".  Maybe I didn't know this when I wrote this code,
and thought the check for $val would only reject "-isomething".

But "git-rebrebase ... -i something" is wrong because it would mean
"git-rebase -i something" and we do not permit the user to specify
their own base.  So it is right to bail out in this case.

However, the message was wrong, since it refers to cuddling, and it
can be caused by a non-cuddled non-option argument.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 340a590999d2551d825de2baed8477fdc168af9d..8f36d9dcf4ccfc5a5fc16295f89e9b8ab643bd59 100755 (executable)
@@ -2950,7 +2950,7 @@ getoptions_main
           'experimental-merge-resolution!', \$opt_merges,
           '-i:s' => sub {
               my ($opt,$val) = @_;
-              badusage f_ "%s: no cuddling to -i for git-rebase", $us
+              badusage f_ "%s: with git-debrebase, get-rebase -i option may only be followed by more options (as separate arguments)", $us
                   if length $val;
               confess if $opt_defaultcmd_interactive; # should not happen
               $opt_defaultcmd_interactive = [ qw(-i) ];