Skip to content

Commit 34840db

Browse files
j6tgitster
authored andcommitted
rebase: do not print lots of usage hints after an obvious error message
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 45e2acf commit 34840db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

git-rebase.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,7 @@ case "$#" in
439439
then
440440
head_name="detached HEAD"
441441
else
442-
echo >&2 "fatal: no such branch: $1"
443-
usage
442+
die "fatal: no such branch: $1"
444443
fi
445444
;;
446445
*)

0 commit comments

Comments
 (0)