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

Re: capturing the packfile from git-upload-pack

From
Jeff King <peff@peff.net>
Date
Apr 15, 2011, 19:25 UTC
Message-ID
<20110415192519.GA5332@sigill.intra.peff.net>
In-Reply-To
<20110415190908.GA4093@sigill.intra.peff.net>
On Fri, Apr 15, 2011 at 03:09:08PM -0400, Jeff King wrote:
Show 24 quoted lines
> On Fri, Apr 15, 2011 at 10:46:28AM -0700, Junio C Hamano wrote:
> 
> > Shawn Pearce <spearce@spearce.org> writes:
> > 
> > > On Thu, Apr 14, 2011 at 23:22, madmarcos <fru574@my.utsa.edu> wrote:
> > >> is there a git command that can capture in a separate file the packfile that
> > >> is generated and transmitted from a "want"ed branch during the
> > >> git-upload-pack command? I need a good sample to study.
> > >
> > > No.
> > >
> > > But you can create an input file yourself, the pkt-line format is
> > > pretty simple. Pipe the input to git-upload-pack, and it will spit
> > > back the response. :-)
> > 
> > If you are running 1.7.5-rc0 or newer, GIT_TRACE_PACKET may also be of
> > help.
> 
> Sadly, no. I punted on outputting the actual pack since it is big and
> binary, and I was only interested in the ref negotiation. My eventual
> plan was that you could do:
> 
>   GIT_TRACE_PACKET=2 GIT_TRACE_PACKET_PACK=/tmp/foo.pack \
>     git clone ...

Actually, thinking on it more, this is kind of stupid. The pack that we fetch will end up in .git/objects/pack, so it's not that interesting to dump (though I suppose in a fetch setting, you might want to actually peek at the thin pack before it gets resolved).

More interesting is for the sender to dump the pack they send, which would mean instrumenting pack-objects.

Or, as Shawn suggested, poking upload-pack yourself using a conversation you read from GIT_TRACE_PACKET. Which is probably what you meant when you suggested it in the first place. So I'll shut up now.

-Peff
Previous: Jeff KingNext: madmarcos
Message 5 of 6 in “capturing the packfile from git-upload-pack”
  1. madmarcosApr 15, 2011
  2. Shawn PearceApr 15, 2011
  3. Junio C HamanoApr 15, 2011
  4. Jeff KingApr 15, 2011
  5. Jeff KingApr 15, 2011
  6. madmarcosApr 16, 2011

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.