threads / patch / 1105

patchBetter error message from git-ssh-push

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

## tl;dr

One message between Jul 4, 2005 and Jul 4, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Daniel Barkalow· Jul 4, 2005, 20:12 UTC · lore

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 <barkalow@iabervon.org>

--- commit 7a274ce1f93e6092dcf226d546a58d2d6df9d13c tree 1f045fa8aa017cabbac613cf8c1ea2bd63ccc46c parent 8934c88118c900fe38abbf60f893ee9ef4e83b3c author Daniel Barkalow <barkalow@iabervon.org> 1120507167 -0400 committer Daniel Barkalow <barkalow@silva-tulga.(none)> 1120507167 -0400

Show changes to diff +6 −2
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;
 

← back to recent threads