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

Re: [PATCH] contrib/subtree: fix split with squashed subtrees

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 2, 2025, 14:57 UTC
Message-ID
<62b50f7e-7ee3-420b-9de3-6d9df611b6b6@gmail.com>
In-Reply-To
<773ed81e-34b4-4116-88de-7e4307b6c679@gmail.com>
On 02/09/2025 14:22, Phillip Wood wrote:
Show 23 quoted lines
> On 01/09/2025 21:43, Colin Stagner wrote:
>> On 9/1/25 08:54, Phillip Wood wrote:
>> Colin Stagner <ask+git@howdoi.land> writes:
>>
>> The outer loop in git-subtree.sh:983 appears to iterate from the root 
>> commit forwards… and not from the HEAD backwards.
>>
>>      git rev-list --topo-order --reverse --parents $rev $unrevs
>>      #                         ^^^^^^^^^
>>
>> Since the iteration is ancestor-first, I'm having difficulty seeing 
>> why `should_ignore_subtree_split_commit()` would want to do an 
>> ancestor traversal at all. It already sees the commits ancestor-first. 
>> But there could be a reason that I don't know.
> 
> Ah, I was only looking at this patch, not how it was called. That begs 
> the question "what's the point of these checks if we've already visited 
> all the ancestors anyway". I think the answer is that it is pruning the 
> recursion that happens in check_parent() and checking the commits that 
> come from that rev-list command is pointless. The regression test 
> introduced with this function only looks at $extracount which comes from 
> the recursion. I haven't looked too closely but it would be nice if we 
> could move this check so it is only run when check_parents() is recursing.

Sorry that's not quite right. check_parents() recurses into process_split_commit() rather than the loop that call should_ignore_subtree_split_commit(). I think what this check does do is prune some parents which stops check_parents() from recursing into other subtrees so the check is in the right place.

Thanks
Phillip
Previous: Phillip WoodNext: Colin Stagner
Message 5 of 15 in “contrib/subtree: fix split with squashed subtrees”
  1. contrib/subtree: fix split with squashed subtreesColin Stagner, Aug 24, 2025
  2. Phillip WoodSep 1, 2025
  3. Colin StagnerSep 1, 2025
  4. Phillip WoodSep 2, 2025
  5. Phillip WoodSep 2, 2025
  6. Colin StagnerSep 4, 2025
  7. contrib/subtree: fix split with squashed subtreesColin Stagner, Sep 5, 2025
  8. Phillip WoodSep 8, 2025
  9. Colin StagnerSep 10, 2025
  10. Junio C HamanoSep 10, 2025
  11. Colin StagnerSep 10, 2025
  12. Junio C HamanoSep 10, 2025
  13. contrib/subtree: fix split with squashed subtreesColin Stagner, Sep 10, 2025
  14. Phillip WoodSep 10, 2025
  15. Junio C HamanoSep 11, 2025

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.