git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jul 4, 2005, 20:12 UTC
Message-ID
<Pine.LNX.4.21.0507041609550.30848-100000@iabervon.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;
 
Message 1 of 1 in “Better error message from git-ssh-push”
  1. Better error message from git-ssh-pushDaniel Barkalow, Jul 4, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.