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

Re: [PATCH] Update packfile transfer protocol documentation

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 2, 2009, 23:57 UTC
Message-ID
<20091102235707.GV10505@spearce.org>
In-Reply-To
<7vzl74trmc.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Scott Chacon <schacon@gmail.com> writes:
> > +
> > +A pack-file MUST be sent if either create or update command is used.
> 
> Easier to read if MUST is followed by "_even_ if", like so:
> 
>     ... MUST be sent when a create or update command is used, even if the
>     server already has all the necessary objects.
> 
> Shouldn't we say "the client MUST NOT make reference update request if
> everything is up to date" which would imply that in practice there is no
> reason to send an empty pack data?

Create a new branch to point at an existing object. Branch creation causes a pack to be expected, but if you are creating a new branch that points at an existing object there is nothing to pack. E.g.:

  git remote add -f A user@host:proj.git
  git push A A/master:refs/heads/new-branch
causes a 0 object pack file to be sent, assuming the remote project's
master branch has not changed in between the two commands.
 
> > +  pack-file         = "PACK" 24*(OCTET)
> 
> Curious---where does this 24 come from?
Hmmph.  Its wrong actually.  I was trying to write the minimum
number of bytes that make up a pack file, which is actually 28.
(12 in the header minus 4 as "PACK" was already spelled out, plus
20 in the footer for the SHA-1).
 
-- 
Shawn.
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 16 in “Update packfile transfer protocol documentation”
  1. Update packfile transfer protocol documentationScott Chacon, Nov 1, 2009
  2. Junio C HamanoNov 2, 2009
  3. Shawn O. PearceNov 2, 2009
  4. Junio C HamanoNov 2, 2009
  5. Shawn O. PearceNov 2, 2009
  6. Junio C HamanoNov 2, 2009
  7. Shawn O. PearceNov 2, 2009
  8. Junio C HamanoNov 3, 2009
  9. Shawn O. PearceNov 3, 2009
  10. Scott ChaconNov 3, 2009
  11. Junio C HamanoNov 4, 2009
  12. Junio C HamanoNov 4, 2009
  13. Shawn O. PearceNov 4, 2009
  14. Junio C HamanoNov 4, 2009
  15. Shawn O. PearceNov 4, 2009
  16. Junio C HamanoNov 4, 2009

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.