git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git network protocol
@ 2006-08-14  6:21 Josef "Jeff" Sipek
  2006-08-14  6:42 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Josef "Jeff" Sipek @ 2006-08-14  6:21 UTC (permalink / raw)
  To: git

Hello,

I'm trying to implement the git protocol, and I am having a bit of an issue
with the lack of information available about it (please correct me if I
missed some source of information.)

I understand the basic format of the protocol, however I'm not sure what
"command" can follow what. I also noticed some odd inconsistencies (or maybe
I just don't see the pattern yet.) For example, a git-clone generates this
traffic:

C: git-upload-pack ....
S: SHA1 HEAD....
S: SHA1 refs/heads/master
S: flush
C: want SHA1...
C: want SHA1... (it wants the same SHA1 twice!)
C: flush
C: done
S: NAK
S: the pack...

Then, when it is time to git-fetch a new commit, I get:

C: git-upload-pack ....
S: SHA1 HEAD....
S: SHA1 refs/heads/master
S: flush
C: want SHA1...
C: flush
C: have SHA1
C: done
S: ACK SHA1 continue
S: ACK SHA1 (same hash)
S: the pack...

Then, if I try to git-fetch but there is nothing new, I get:

C: git-upload-pack ....
S: SHA1 HEAD....
S: SHA1 refs/heads/master
S: flush
C: flush
<client closes connection>

So, I can _assume_ that "done" tells the server that it is time to make a
pack. Why does the server use NAK during the clone operation, but ACK
during fetch? Why does the server ACK the same SHA1 twice? And why does the
client "want" the same SHA1 twice? It just seems odd.

I think it would be great if there was some kind of description somewhere
that detailed the protocol. Also, the daemon source isn't the prettiest
thing in the world.

Thanks,
Josef "Jeff" Sipek.

-- 
Reality is merely an illusion, albeit a very persistent one.
		- Albert Einstein

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Mercurial 0.4b vs git patchbomb benchmark
@ 2005-04-29 19:47 Noel Maddy
  2005-04-29 19:54 ` Tom Lord
  0 siblings, 1 reply; 7+ messages in thread
From: Noel Maddy @ 2005-04-29 19:47 UTC (permalink / raw)
  To: Tom Lord; +Cc: seanlkml, git

On Fri, Apr 29, 2005 at 12:28:41PM -0700, Tom Lord wrote:
> 
> Think of it this way:
> 
>   (a) Joe, the mainline maintainer, gets a trusted message containing
>       a diff.
> 
>   (b) Joe reads the diff, it makes great sense, he wants to merge.
> 
>   (c) Joe downloads a tree.  Supposedly that tree is the result of
>       applying this diff.   The tree, not the diff, is used for
>       merging.

Call me a naive git, but seems to me the "git way" is a little
different. It's tree-based rather than diff-based, and doesn't involve
passing diffs around, right?

This is the process I'd expect:

    (a)' Joe is notified of an update made to an external git tree

    (b)' Joe pulls tree from the external git tree (signed by external
         developer)

    (c)' Joe reviews the (git-generated) diffs from his current
	     (trusted) tree to the new (signed) tree. If they pass
         review, he merges the new versions into his tree, commits,
         and signs his tree.

The logical hole that you point out is assuming that the diff is passed
separately from the tree rather than being directly generated from the
current maintainer tree and the signed remote tree.

If the diff is generated from the two signed trees, I don't see a hole.

Or am I missing something?


-- 
The world's largest Internet database in the country.
					      -- Trading Times radio ad
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Noel Maddy <noel@zhtwn.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-08-15  9:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-14  6:21 Git network protocol Josef "Jeff" Sipek
2006-08-14  6:42 ` Junio C Hamano
2006-08-14 23:48   ` Josef "Jeff" Sipek
2006-08-15  0:59     ` Junio C Hamano
2006-08-15  9:14       ` Josef "Jeff" Sipek
  -- strict thread matches above, loose matches on Subject: below --
2005-04-29 19:47 Mercurial 0.4b vs git patchbomb benchmark Noel Maddy
2005-04-29 19:54 ` Tom Lord
2005-04-29 20:21   ` Noel Maddy
2005-04-29 20:42     ` git network protocol David Lang
2005-04-29 21:15       ` Daniel Barkalow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).