{"thread":{"id":"27719","subject":"[PATCH] rebase: do not print lots of usage hints after an obvious error message","startedAt":"2011-06-28T12:46:14Z","lastAt":"2011-06-28T15:54:34Z","messageCount":2,"participants":["Johannes Sixt","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"170622","messageId":"4E09CD16.2040800@viscovery.net","threadId":"27719","inReplyTo":null,"subject":"[PATCH] rebase: do not print lots of usage hints after an obvious error message","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-06-28T12:46:14Z","receivedAt":"2011-06-28T12:46:14Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nWhen a non-existent branch was specified to be rebased, the complete\nusage information is printed after the error message that carries the\nrelevant piece of information:\n\n   $ git rebase master topci\n   fatal: no such branch: topci\n   usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]\n      or: git rebase [-i] [options] --onto <newbase> --root [<branch>]\n      or: git-rebase [-i] --continue | --abort | --skip\n\n   Available options are\n   [30 lines of usage stripped]\n\nThe error message was introduced recently by 4ac5356c (rebase: give a\nbetter error message for bogus branch, 2011-01-27), and the result was\nacceptable because the usage text was just two lines. But 45e2acf3\n(rebase: define options in OPTIONS_SPEC, 2011-02-28) made things worse\nbecause the usage text is now 35 lines.\n\nJust drop the usage information because it does not add value to the\nerror message.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n Note: git-sh-setup's die() does not print \"fatal: \".\n\n git-rebase.sh |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex d7855ea..4761f28 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -441,8 +441,7 @@ case \"$#\" in\n \tthen\n \t\thead_name=\"detached HEAD\"\n \telse\n-\t\techo >&2 \"fatal: no such branch: $1\"\n-\t\tusage\n+\t\tdie \"fatal: no such branch: $1\"\n \tfi\n \t;;\n *)\n-- \n1.7.6.86.gdfda2\n"},{"id":"170629","messageId":"20110628155434.GA3747@sigill.intra.peff.net","threadId":"27719","inReplyTo":"4E09CD16.2040800@viscovery.net","subject":"Re: [PATCH] rebase: do not print lots of usage hints after an obvious error message","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-06-28T15:54:34Z","receivedAt":"2011-06-28T15:54:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 28, 2011 at 02:46:14PM +0200, Johannes Sixt wrote:\n\n> The error message was introduced recently by 4ac5356c (rebase: give a\n> better error message for bogus branch, 2011-01-27), and the result was\n> acceptable because the usage text was just two lines. But 45e2acf3\n> (rebase: define options in OPTIONS_SPEC, 2011-02-28) made things worse\n> because the usage text is now 35 lines.\n> \n> Just drop the usage information because it does not add value to the\n> error message.\n\nAcked-by: Jeff King <peff@peff.net>\n\nA git-sh-setup function to print just the summary bit of the usage would\nrestore the original behavior, but I agree it's not really adding\nanything.\n\n-Peff\n"}]}