DORMANTno replies

[PATCH] Better error message from git-ssh-push

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:42:01

If git-ssh-push can't interpret the commit-id, there are various possible
issues. Just giving the usage message makes it hard to identify what could
be wrong.

Signed-off-by: Daniel Barkalow <redacted>

---
commit 7a274ce1f93e6092dcf226d546a58d2d6df9d13c
tree 1f045fa8aa017cabbac613cf8c1ea2bd63ccc46c
parent 8934c88118c900fe38abbf60f893ee9ef4e83b3c
author Daniel Barkalow [off-list ref] 1120507167 -0400
committer Daniel Barkalow <barkalow@silva-tulga.(none)> 1120507167 -0400

Index: ssh-push.c
===================================================================
--- 62a74516551505e5fd2b5c2fd14486f3ac8a400e/ssh-push.c  (mode:100644 sha1:10390948efacfa06f4f6fc6b2f3631cec6fcb876)
+++ 1f045fa8aa017cabbac613cf8c1ea2bd63ccc46c/ssh-push.c  (mode:100644 sha1:6b1406b527ba6ede8602a04ab031003edb7da2b0)
@@ -257,8 +257,12 @@
 		usage(ssh_push_usage);
 	commit_id = argv[arg];
 	url = argv[arg + 1];
-	if (get_sha1(commit_id, sha1))
-		usage(ssh_push_usage);
+	if (get_sha1(commit_id, sha1)) {
+		fprintf(stderr, 
+			"Unable to interpret %s as something to push.\n",
+			commit_id);
+		return 1;
+	}
 	memcpy(hex, sha1_to_hex(sha1), sizeof(hex));
 	argv[arg] = hex;
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help