Re: [PATCH 1/2] git-subtree: Bail out if we find output from Rust rewrite [and 1 more messages]
- From
D. Ben Knoble <ben.knoble@gmail.com>
- Date
- Jul 11, 2026, 13:41 UTC
- Message-ID
- <CALnO6CAPMEjVsj-5X9VyUtGM1JipXj6g_0JrC5gk37s178G02A@mail.gmail.com>
- In-Reply-To
- <27215.27575.968985.583226@chiark.greenend.org.uk>
Hi Ian,
On Thu, Jul 9, 2026 at 5:48 AM Ian Jackson <ijackson@chiark.greenend.org.uk> wrote: [snip]
Show 35 quoted lines
> > On 7/6/26 06:58, Ian Jackson wrote: > > > Another, bigger, reason is that current git-subtree generates unmarked > > > subtree merges (ie, without any git-subtree trailers) > > > > Subtree merges can be performed without git-subtree, via the `-X > > subtree` merge strategy option. While the design of RIIR git-subtree is > > outside the scope of this patch series, this may be worth thinking about > > in your rewrite. > > This is what I'm calling an "unmarked subtree merge". My rewrite is > not going to support this user behaviour. The problem is that it is > not possible to reliably determine whetheer something is an unmarked > subtree merge. > > It is possible to guess based on tree similarity, but that's a > heuristic. It's also possible to guess based on root commits. > Both of these approaches can go wrong in some cases. I prefer to > write reliable software, which doesn't guess. > > I'll advise against this practice in the documentation, but I'm > reasonably confident that if a user does this anyway the results won't > be terrible. The upstream input to an unmarked subtree merge in a > downstream that has already used my rewrite, will be treated as if it > were a downstream branch that predates the subtree addition. The > effect on split (in most cases) is a missing parent relationship, > which is undesirable but not catastrophic.I've made a note to add a > test case for this scenario. > > Combining manual -X subtree merges with git-subtree --squash merges > could easily produce quite weird and wrong results in the tree (even > before anyone tries split, or something). I don't think I can even > reliably detect this situation after the user has done it, and of > course since that user is using plain git, I certainly can't prevent > it. This is another reason why manual use of -X subtree should be > discouraged.
Just to make sure I understand you (I regularly use -X subtree with one project): the Rust rewrite won't support -X subtree merges, but we don't intend to discourage folks from using -X subtree merges in toto, right? Merely not support a mix of the 2?