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

cg-push protocol proposal

From
MJMcMullan, Jason <jason.mcmullan@timesys.com>
Date
Jun 2, 2005, 12:54 UTC
Message-ID
<1117716883.32257.42.camel@jmcmullan.timesys>

I'd like to propose the following protocol for 'pushes'. Assume that a 'git-daemon' is the 'server', and is talking on stdin/stdout.

Each command is an ascii string, followed by a LF (\n)
Request current head ID:
	  head <head-name>\n
	Responses:
	  head <head-name> <sha1>\n
	  error <head-name> <hex-code> <error-string>\n
Request a SHA1 blob from the server
	  send <sha1>\n
	Responses:
	  send <sha1> <hex-size>\n<bytes...>
	  error <sha1> <hex-code> <error-string>\n
Update head ID to a SHA1 (the SHA1 may already be in the server's DB)
	  head <head-name> <old-sha1> <sha1>\n
1)	Response if <head-name> is now <sha1>:
	  head <head-name> <sha1>\n
	Response if error, or head locked by someone else updating:
	  error <head-name> <hex-code> <error-string>\n
	Response if <sha1> is not in the database:
	  send <sha1>\n		- Server needs the blob
2)	Client response if 'send' is returned:
 
	  send <sha1> <hex-size>\n<bytes...>
3)	Response if more objects are needed 
          (ie you sent a commit or tree object)
	  send <new-sha1>\n	- Server needs blob
	  Remember the SHA1 you sent, 'call' step 2) with new-sha1 
	  Goto 3)
	Response if send succeeded:
	  exists <sha1>\n
	Response if send failed:
	  error <sha1> <hex-code> <error-string>\n
TODO: Tags
	
-- 
Jason McMullan <jason.mcmullan@timesys.com>
TimeSys Corporation
Next: McMullan, Jason
Message 1 of 2 in “cg-push protocol proposal”
  1. McMullan, JasonJun 2, 2005
  2. McMullan, JasonJun 2, 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.