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
Oct 14, 2019, 23:56 UTC
Message-ID
<20191014235628.153287-1-jonathantanmy@google.com>
In-Reply-To
<20191014222749.GB233821@google.com>
Thanks for your comments. Rearranging them:
> This makes me wonder why we don't also change index-pack to write a
> similar message to the .promisor. I guess there's potentially too much
> information to shove all the refs on the command-line?

index-pack already is capable of writing messages to .promisor using the "--promisor" argument. You're right that I'm not using that because I don't want to run into argument length limits.

> I am not sure why we want to tie creating the .promisor to creating the
> lockfile. I'll keep reading and see if it becomes clear later. Other
> than that, the logic here seems clear.
[snip]
Show 6 quoted lines
> Apart from using the lockfile name as the base for the .promisor
> filename, I'm still not seeing why we need to tie this to the fact that
> we're creating a lockfile. Could we instead just unconditionally create
> the .promisor when args->from_promisor is set, and then remove the logic
> in the previous chunk that adds the "--promisor" flag to the index-pack
> call?

I'm tying the promisor to the lockfile to avoid overcomplicating things: fetch-pack currently reads filename information from index-pack only when there is a lockfile. (It could do so even when there is no lockfile, but it currently does not.) We need this filename to know what to call the ".promisor" file.

And the situation that I'm interested in - when the user fetches with "git fetch" from http or ssh - always uses a lockfile (see fetch_refs_via_pack() in transport.c). So I'm writing additional data in this case, and falling back on the "--promisor" flag otherwise. I'll elaborate in the commit message.

Previous: Josh SteadmonNext: Jonathan Tan
Message 10 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.