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

Re: subtree split includes unrelated commits

From
DLDouglas Leonard <dleonard.dev@gmail.com>
Date
Jun 25, 2021, 00:58 UTC
Message-ID
<CADdMKP8kY-ry4ZWmp1hLCne328cC4thgavbkXOjdaNpD_ockSg@mail.gmail.com>
I hope I got this reply sent to the right thread.
> I found the issue to be related with the following change in git-subtree.sh:
Show 5 quoted lines
> > Revision: 933cfeb90b5d03b4096db6d60494a6eedea25d03
> > Author: Dave Ware <davidw@realtimegenomics.com>
> > Date: 15.01.2016 01:41:43
> > Message:
> > contrib/subtree: fix "subtree split" skipped-merge bug
Show 5 quoted lines
> > 'git subtree split' can incorrectly skip a merge even when both parents
> > act on the subtree, provided the merge results in a tree identical to
> > one of the parents. Fix by copying the merge if at least one parent is
> > non-identical, and the non-identical parent is not an ancestor of the
> > identical parent.

Hmm... I'm not expert on the implementation details of subtree split. But I wonder if this should have said "if at least one parent is non-subtree-identical"? Maybe that's what was meant. I just went through writing a similar "degenerate merge" (to adopt the filter-repo terminology for it) detection for git-alltrees, although I'm not sure alltrees would handle this particular case to your liking either. I think I discard merges if either parent is subtree-identical to the merge commit, probably keeping only the matching branch, but I'm not sure that's always true, and that's there, not here.

Cheers, Doug

Next: Douglas Leonard
Message 1 of 2 in “Re: subtree split includes unrelated commits”
  1. Douglas LeonardJun 25, 2021
  2. Douglas LeonardJun 25, 2021

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.