path: root/
diff options
authorDirk Wallenstein <>2013-07-17 17:28:11 (GMT)
committerJunio C Hamano <>2013-07-17 19:30:58 (GMT)
commitace33bf991f8f6643e58a3642962ed244ba36b5b (patch)
tree869e255f8fd229ab6d645ea999e335d1ac0ae040 /
parent239222f587ed06f96d90dd71c66d80a2b1e3dc9f (diff)
request-pull: improve error message for invalid revision args
Currently, when an invalid revision is specified, the error message is: fatal: Needed a single revision This is misleading because, you might think there is something wrong with the command line as a whole. Now the user gets a more meaningful error message, showing the invalid revision. Signed-off-by: Dirk Wallenstein <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 12 insertions, 2 deletions
diff --git a/ b/
index d566015..ebf1269 100755
--- a/
+++ b/
@@ -51,8 +51,18 @@ fi
tag_name=$(git describe --exact "$head^0" 2>/dev/null)
test -n "$base" && test -n "$url" || usage
-baserev=$(git rev-parse --verify "$base"^0) &&
-headrev=$(git rev-parse --verify "$head"^0) || exit
+baserev=$(git rev-parse --verify --quiet "$base"^0)
+if test -z "$baserev"
+ die "fatal: Not a valid revision: $base"
+headrev=$(git rev-parse --verify --quiet "$head"^0)
+if test -z "$headrev"
+ die "fatal: Not a valid revision: $head"
merge_base=$(git merge-base $baserev $headrev) ||
die "fatal: No commits in common between $base and $head"