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

[PATCH] Tell users that git protocol is not for pushing

From
Nathan W. Panike <nathan.panike@gmail.com>
Date
Nov 11, 2008, 05:06 UTC
Message-ID
<1226379976-5959-1-git-send-email-nathan.panike@gmail.com>

When one attempts to push to a git-protocol repository, one gets the line:

fatal: The remote end hung up unexpectedly
This seems a bit obscure to me.  It is better to inform the user that git://
does not allow pushing.
---
 transport.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/transport.c b/transport.c
index 56831c5..2c1577e 100644
--- a/transport.c
+++ b/transport.c
@@ -684,7 +684,9 @@ static int git_transport_push(struct transport *transport, int refspec_nr, const
 	args.use_thin_pack = data->thin;
 	args.verbose = !!(flags & TRANSPORT_PUSH_VERBOSE);
 	args.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN);
-
+	if(strncmp(transport->url,"git",3)==0){
+		fprintf(stderr,"git protocol does not support push.\n");
+	}
 	return send_pack(&args, transport->url, transport->remote, refspec_nr, refspec);
 }
 
-- 
1.6.0.4
Next: Alex Riesen
Message 1 of 2 in “Tell users that git protocol is not for pushing”
  1. Tell users that git protocol is not for pushingNathan W. Panike, Nov 11, 2008
  2. Alex RiesenNov 11, 2008

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.