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

1 messages from 2005-07-04 to 2005-07-04. Participants: Daniel Barkalow.
Thread: https://gitlist.dev/t/1105

## Daniel Barkalow, 2005-07-04 20:12

Subject: [PATCH] Better error message from git-ssh-push
Message-ID: <Pine.LNX.4.21.0507041609550.30848-100000@iabervon.org>
URL: https://gitlist.dev/e/Pine.LNX.4.21.0507041609550.30848-100000%40iabervon.org

```
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

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;
 

```
