Skip to content

Commit

Permalink
rebase: do not print lots of usage hints after an obvious error message
Browse files Browse the repository at this point in the history
When a non-existent branch was specified to be rebased, the complete
usage information is printed after the error message that carries the
relevant piece of information:

   $ git rebase master topci
   fatal: no such branch: topci
   usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
      or: git rebase [-i] [options] --onto <newbase> --root [<branch>]
      or: git-rebase [-i] --continue | --abort | --skip

   Available options are
   [30 lines of usage stripped]

The error message was introduced recently by 4ac5356 (rebase: give a
better error message for bogus branch, 2011-01-27), and the result was
acceptable because the usage text was just two lines. But 45e2acf
(rebase: define options in OPTIONS_SPEC, 2011-02-28) made things worse
because the usage text is now 35 lines.

Just drop the usage information because it does not add value to the
error message.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Jun 29, 2011
1 parent 45e2acf commit 34840db
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,7 @@ case "$#" in
then
head_name="detached HEAD"
else
echo >&2 "fatal: no such branch: $1"
usage
die "fatal: no such branch: $1"
fi
;;
*)
Expand Down

0 comments on commit 34840db

Please sign in to comment.