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

Re: [PATCH v2 3/4] t5300: move --window clamp test next to unclamped

From
Jeff King <peff@peff.net>
Date
Nov 15, 2024, 09:52 UTC
Message-ID
<20241115095244.GC1749331@coredump.intra.peff.net>
In-Reply-To
<xmqqiksq71x7.fsf@gitster.g>
On Thu, Nov 14, 2024 at 03:41:08PM +0900, Junio C Hamano wrote:
Show 25 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >> As far as I know, index-pack, when run as part of fetch, indexes a pack
> >> that's not in the repository's object store; it indexes a packfile in a
> >> temp directory. (So I don't think this is a strange thing to do.)
> >
> > When fetching (or receiving a push), we use "index-pack --stdin" and do
> > write the resulting pack into the repository (and the command will
> > complain if there is no repository).
> > ...
> >> We definitely should prevent the segfault, but I think that's better
> >> done by making --promisor only work if we run index-pack from within a
> >> repo. I don't think we can restrict the repacking to run only if we're
> >> indexing a pack within the repo, because in our fetch case, we're
> >> indexing a new pack - not one within the repo.
> >
> > I think the "--stdin" thing above neatly solves this.
> [...]
> 
> Tying this extra processing to the use of "--stdin" is not exactly
> intuitive, in that a "--stdin" user is not necessarily doing a fetch
> (even though a fetch may always use "--stdin"), but I guess it is a
> good enough approximation (and the best one easily available to us)
> if we want to safeguard the use of this "--promisor" logic only to
> fetch client.

I think the "--stdin" thing is a bit more general than that. Even though we expect to use it with --promisor only under fetch, the real rule is more like: only do the extra --promisor repacking when indexing a pack that will be made available in the repository. With --stdin, we know the result will be available because index-pack itself will write the pack into the repository. And that is true whether it is fetch, push, or some other script driving it.

When being fed a path to a pack on the command line, then "is it available in the repo" would involve some path comparisons to see if it's in the object database directory. Probably not that hard, but not entirely trivial (due to normalization, etc). But since we care only about fetch and --stdin, it seemed like an easy cheat to simply disallow the other case for now, erring on the conservative side.

-Peff
Previous: Junio C HamanoNext: Jonathan Tan
Message 25 of 37 in “When fetching from a promisor remote, repack local objects referenced”
  1. 0/5 When fetching from a promisor remote, repack local objects referencedJonathan Tan, Oct 24, 2024
  2. 1/5 pack-objects: make variable non-staticJonathan Tan, Oct 24, 2024
  3. Taylor BlauOct 28, 2024
  4. Jonathan TanOct 28, 2024
  5. Taylor BlauOct 28, 2024
  6. Jonathan TanOct 28, 2024
  7. 2/5 t0410: make test description clearerJonathan Tan, Oct 24, 2024
  8. 3/5 t0410: use from-scratch serverJonathan Tan, Oct 24, 2024
  9. 4/5 t5300: move --window clamp test next to unclampedJonathan Tan, Oct 24, 2024
  10. 5/5 index-pack: repack local links into promisor packsJonathan Tan, Oct 24, 2024
  11. Josh SteadmonOct 30, 2024
  12. Jonathan TanNov 1, 2024
  13. Han YoungOct 25, 2024
  14. Taylor BlauOct 25, 2024
  15. Junio C HamanoNov 2, 2024
  16. Taylor BlauOct 25, 2024
  17. 0/4 When fetching from a promisor remote, repack local objects referencedJonathan Tan, Nov 1, 2024
  18. 1/4 t0410: make test description clearerJonathan Tan, Nov 1, 2024
  19. 2/4 t0410: use from-scratch serverJonathan Tan, Nov 1, 2024
  20. 3/4 t5300: move --window clamp test next to unclampedJonathan Tan, Nov 1, 2024
  21. Jeff KingNov 13, 2024
  22. Jonathan TanNov 13, 2024
  23. Jeff KingNov 14, 2024
  24. Junio C HamanoNov 14, 2024
  25. Jeff KingNov 15, 2024
  26. Jonathan TanNov 15, 2024
  27. Jeff KingNov 16, 2024
  28. index-pack: teach --promisor to require --stdinJonathan Tan, Nov 18, 2024
  29. Junio C HamanoNov 19, 2024
  30. Jeff KingNov 19, 2024
  31. Junio C HamanoNov 20, 2024
  32. index-pack: teach --promisor to forbid pack nameJonathan Tan, Nov 19, 2024
  33. Jeff KingNov 20, 2024
  34. Jeff KingNov 14, 2024
  35. 4/4 index-pack: repack local links into promisor packsJonathan Tan, Nov 1, 2024
  36. Junio C HamanoNov 4, 2024
  37. Junio C HamanoNov 4, 2024

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.