[PATCH 0/2] git-subtree: Bail out if we find output from Rust rewrite
From: Ian Jackson <hidden>
Date: 2026-07-06 13:04:00
My rewrite of git-subtree is coming along fairly nicely. I have done a bunch of data model design work, as well as successfully implemented the "split" operation. (It's several orders of magnitude faster than the shell script implementation, and produces much better output.) I have concluded that it is going to be too difficult to have bidirectional interoperability, for a number of reasons. One reason is that I want to change the way split commits are constructed and they should be as stable as we can make them. Another, bigger, reason is that current git-subtree generates unmarked subtree merges (ie, without any git-subtree trailers); reliably figuring out whether something is such a merge requires a complete history walk, which is very unfortunate. To avoid having to do this in perpetuity, I plan to have new git-subtree assume that commits which show signs of use of new git-subtree are not unmarked subtree merges generated by old git-subtree. So mycompatibility plan is: - New git-subtree can read old git-subtree data - Old git-subtree (this one here) will *not* handle new data New git-subtree needs an in-downstream-tree config file with at least an indication of the downstream project name, because otherwise split commits can be quite inscrutable. So the presence of that file is a convenient way to signal the change. The purpose of the present patch is to help prevent messes, where old git-subtree is used *afer* new git-subtree, generating output that no tooling can handle correctly. We change old git-subtree to spot the new git-subtree's config file, and bail out. Right now there is no new data in existence, becauwe new git-subtree is not useable. So right now this change has no effect. But if we ship this change now, users with this change will be defended from this lossage, as their collaborators start to use new git-subtree. I'm hoping to possibly persuade distros etc. to take this patch as a backport. I wasn't sure how precisely to word the error message. I chose to refer to the new tool, as if it really exists. By the time anyone actually seex this message, it will do. Ian Jackson (2): git-subtree: Bail out if we find output from Rust rewrite git-subtree: Bail out if we find output from Rust rewrite (test) contrib/subtree/git-subtree.sh | 18 ++++++++++++++++++ contrib/subtree/t/t7900-subtree.sh | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) -- 2.47.3