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

Re: [PATCH v2 1/2] revision: mark contents of an uninteresting tree uninteresting

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 16, 2014, 00:35 UTC
Message-ID
<xmqq61pk227v.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140116001607.GN18964@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 10 quoted lines
> Junio C Hamano wrote:
>
>> we see the top-level tree marked as uninteresting (i.e. ^A^{tree} in
>> the above example) and call mark_tree_uninteresting() on it; this
>> unfortunately prevents us from recursing into the tree and marking
>> the objects in the tree as uninteresting.
>
> So the tree is marked uninteresting twice --- once by setting in the
> UNINTERESTING flag in handle_revision_arg() and a second attempted
> time in mark_tree_uninteresting()?   Makes sense.

It is that the original code, the setting of the mark on the object itself was inconsistent. For commits, we did that ourselves; for trees, we let the mark_tree_uninteresting() do so.

And mark_tree_uninteresting() has this quirk that it refuses to recurse into the given tree, if the tree is already marked as uninteresting by the caller.

We did not have the same problem on commits, because we make a similar call to mark-parents-uninteresting but the function does not care if the commit itself is already marked as uninteresting.

The distinction does not matter when tags are not involved. But once we start propagating the flags from a tag to objects that the tag points at, it starts to matter. The caller will mark the object uninteresting in the loop that peels the tag, and the resulting object is uninteresting. It is not a problem for commits. It was a problem for trees, which used mark_tree_uninteresting() to mark all the objects inside the tree uninteresting, including the tree itself.

Previous: Jonathan NiederNext: Junio C Hamano
Message 4 of 6 in “Propagating flags carefully from the command line”
  1. 0/2 Propagating flags carefully from the command lineJunio C Hamano, Jan 15, 2014
  2. 1/2 revision: mark contents of an uninteresting tree uninterestingJunio C Hamano, Jan 15, 2014
  3. Jonathan NiederJan 16, 2014
  4. Junio C HamanoJan 16, 2014
  5. 2/2 revision: propagate flag bits from tags to pointeesJunio C Hamano, Jan 15, 2014
  6. Jeff KingJan 21, 2014

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.