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

Re: [PATCH] fetch-pack: write fetched refs to .promisor

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Aug 27, 2019, 21:50 UTC
Message-ID
<20190827215054.109496-1-jonathantanmy@google.com>
In-Reply-To
<xmqqmufu2w25.fsf@gitster-ct.c.googlers.com>
Show 7 quoted lines
> Jonathan Tan <jonathantanmy@google.com> writes:
> 
> > As written in the NEEDSWORK comment, repack does not preserve the
> > contents of .promisor files, but I thought I'd send this out anyway as
> > this change is already useful for users who don't run repack much.
> 
> What do you exactly mean by "much" here?

For diagnostic information to be preserved, the user must not have run repack between the fetch and the discovery of a problem. Admittedly, this is probablistic, but if the user never GCs (for example), this would work.

Show 6 quoted lines
> The comment sounds like it
> is saying "running this code once and you'd make the commits and
> objects that were depending on the existing promisor invalid", in
> which case it would be more like "it is already useful for users
> until they run their first repack that destroyes their repository",
> but certainly that is not what we want to do, so...

To be clear, repacks will not destroy their repository, whether before or after this change. Before and after this change, a repack will just collect all promisor objects from all promisor packs (that is, the ones with .promisor) into one single pack, and then generate an empty .promisor file to indicate that the new single pack is a promisor pack. The difference is that before this change, Git does not write anything into the .promisor file (at least for fetches), so nothing is lost. With this change, we now write something for fetches, so something is lost (since we delete all the old packs, including the .promisor files).

But the only thing lost is diagnostic information (for humans - to diagnose, the user will need to open the .promisor file in a text editor) - commits/objects are still valid, and the repository is not destroyed.

Previous: Junio C HamanoNext: Jeff King
Message 3 of 12 in “fetch-pack: write fetched refs to .promisor”
  1. fetch-pack: write fetched refs to .promisorJonathan Tan, Aug 26, 2019
  2. Junio C HamanoAug 27, 2019
  3. Jonathan TanAug 27, 2019
  4. Jeff KingSep 5, 2019
  5. Junio C HamanoSep 5, 2019
  6. Jeff KingSep 5, 2019
  7. Jonathan TanSep 5, 2019
  8. Jeff KingOct 2, 2019
  9. Josh SteadmonOct 14, 2019
  10. Jonathan TanOct 14, 2019
  11. fetch-pack: write fetched refs to .promisorJonathan Tan, Oct 15, 2019
  12. Josh SteadmonOct 15, 2019

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.