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

Re: [PATCH] commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by default

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 16, 2023, 11:19 UTC
Message-ID
<ZVX6so-Gj_ES_FR8@tanuki>
In-Reply-To
<xmqqh6lmwogq.fsf@gitster.g>
On Thu, Nov 16, 2023 at 09:07:01AM +0900, Junio C Hamano wrote:
Show 26 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> >> Yeah. Just like we auto-enabled GIT_REF_PARANOIA for git-gc, etc, I
> >> think we should do the same here.
> >
> > I'm honestly still torn on this one. There are two cases that I can
> > think of where missing objects would be benign and where one wants to
> > use `git rev-list --missing`:
> >
> >     - Repositories with promisor remotes, to find the boundary of where
> >       we need to fetch new objects.
> >
> >     - Quarantine directories where you only intend to list new objects
> >       or find the boundary.
> >
> > And in neither of those cases I can see a path for how the commit-graph
> > would contain such missing commits when using regular tooling to perform
> > repository maintenance.
> 
> I can buy the promisor remotes use case---we may expect boundary
> objects missing without any repository corruption.  I do not know
> about the other one---where does our "rev-list --missing" start
> traversing in a quarantine directory is unclear. Objects that are
> still in quarantine are not (yet) made reachable from any refs, so
> even "rev-list --missing --all" would not make a useful traversal,
> no?

You typically know about the new tips when having a quarantine directory. So you can discover the boundary between objects in your quarantine directory and your main object database by executing `git rev-list $NEWREVS --missing=print` and execute that command with `GIT_OBJECT_DIRECTORY=$quarantine`. The benefit is that this scales with the number of objects in the quarantine, and not with the size of the overall repository.

As mention, this is really niche, but we do plan to use this in Gitaly eventually.

Show 7 quoted lines
> In any case, it sounds like you are not torn but are convinced that
> we should leave this loose by default ;-) and after thinking it over
> again, I tend to agree that it would be a better choice, as long as
> the feature "rev-list --missing" has any good use case other than
> corruption in repository.
> 
> So,... thanks for pushing back.

Okay, glad to hear that I'm not totally bonkers then. I'm going to wait another few days for additional feedback before sending a v2. But if what I'm saying also makes sense to others then v2 would only squash in the diff I sent to run the subset of tests that is now failing with `GIT_COMMIT_GRAPH_PARANOIA=true`.

Patrick
Previous: Junio C HamanoNext: Jeff King
Message 11 of 16 in “commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by default”
  1. commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by defaultPatrick Steinhardt, Nov 14, 2023
  2. Patrick SteinhardtNov 14, 2023
  3. Taylor BlauNov 14, 2023
  4. Junio C HamanoNov 14, 2023
  5. Junio C HamanoNov 14, 2023
  6. Jeff KingNov 14, 2023
  7. Junio C HamanoNov 15, 2023
  8. Jeff KingNov 15, 2023
  9. Patrick SteinhardtNov 15, 2023
  10. Junio C HamanoNov 16, 2023
  11. Patrick SteinhardtNov 16, 2023
  12. Jeff KingDec 6, 2023
  13. commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by defaultPatrick Steinhardt, Nov 20, 2023
  14. Junio C HamanoNov 23, 2023
  15. Patrick SteinhardtNov 24, 2023
  16. commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by defaultPatrick Steinhardt, Nov 24, 2023

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.