git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linux@horizon.com
To: git@vger.kernel.org
Cc: linux@horizon.com
Subject: git-rev-parse --verify could be friendlier
Date: 10 Oct 2007 10:24:17 -0400	[thread overview]
Message-ID: <20071010142417.8892.qmail@science.horizon.com> (raw)

I accidentally typed "git rebase --onto typo ancestor", where "typo"
was a branch that didn't exist.

The error message (which is actually generated by git-rev-parse --verify)
is "fatal: Needed a single revision".

This is perhaps a bit obscure.  For starters, it doesn't even tell me
which argument is problematic.

If I do "git rebase --onto dest typo", I at least get
fatal: Needed a single revision
invalid upstream typo

Something like the following would certainly help, but perhaps git-rev-parse
could be slightly more forthcoming, too?

diff --git a/git-rebase b/git-rebase
index 058fcac..b14ac95 100755
--- a/git-rebase
+++ b/git-rebase
@@ -268,7 +268,8 @@ upstream=`git rev-parse --verify "${upstream_name}^0"` ||
 
 # Make sure the branch to rebase onto is valid.
 onto_name=${newbase-"$upstream_name"}
-onto=$(git rev-parse --verify "${onto_name}^0") || exit
+onto=$(git rev-parse --verify "${onto_name}^0") ||
+    die "invalid target $upstream_name"
 
 # If a hook exists, give it a chance to interrupt
 if test -x "$GIT_DIR/hooks/pre-rebase"
@@ -294,7 +295,8 @@ case "$#" in
 	fi
 	;;
 esac
-branch=$(git rev-parse --verify "${branch_name}^0") || exit
+branch=$(git rev-parse --verify "${branch_name}^0") ||
+    die "invalid branch name $upstream_name"
 
 # Now we are rebasing commits $upstream..$branch on top of $onto
 

             reply	other threads:[~2007-10-10 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-10 14:24 linux [this message]
2007-10-10 16:37 ` git-rev-parse --verify could be friendlier Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071010142417.8892.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).