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

Re: partial clone: promisor fetch during push (pack-objects)

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Mar 1, 2021, 20:55 UTC
Message-ID
<20210301205521.3415173-1-jonathantanmy@google.com>
In-Reply-To
<CAFLLRpLoy6c_WSt1RR2-SPMzKK-MaBpkrCPuGqGGf8SwpCiSEA@mail.gmail.com>
Show 8 quoted lines
> > > 3. But push doesn't pass --missing= to pack-objects anyway, so that
> > > wouldn't actually solve the original issue. Should it?
> >
> > If we fix the bug I described above, I think it's still OK if push
> > doesn't pass --missing=.
> 
> I'll have a go at a patch. Any suggestions on how to approach
> writing/expanding a test to cover this?

I think the main thing is to test that such a push doesn't also fetch. The most straightforward and reliable way I can think of is to run "git count-objects -v" before and after the push. There are other ways like using GIT_TRACE_PACKET and then grep-ping for the absence of "fetch> done" (or something like that) (but I don't like this approach because grep-ping for absence is not robust in the face of typos) or checking the number of files in .git/objects/pack before and after (but that is not robust if Git decides to GC in between).

Previous: Robert Coup
Message 4 of 4 in “partial clone: promisor fetch during push (pack-objects)”
  1. Robert CoupFeb 26, 2021
  2. Jonathan TanFeb 26, 2021
  3. Robert CoupMar 1, 2021
  4. Jonathan TanMar 1, 2021

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.