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

Re: [PATCH 1/2] git-subtree: Bail out if we find output from Rust rewrite [and 1 more messages]

From
CSColin Stagner <ask+git@howdoi.land>
Date
Jul 9, 2026, 22:43 UTC
Message-ID
<c8b81987-ab56-4d6b-a650-879b84597a17@howdoi.land>
In-Reply-To
<27215.27575.968985.583226@chiark.greenend.org.uk>
On 7/9/26 04:36, Ian Jackson wrote:
Show 8 quoted lines
> Colin Stagner writes ("Re: [PATCH 1/2] git-subtree: Bail out if we find output from Rust rewrite"):
>
>> I think that subtree merge should only test the top-level project, as
>> this patch does now.
>
> By "top-level" I think you mean what I've taken to calling the
> "downstream": the project where the subtree is in a subdir, and whose
> top-level has other stuff.  In which case I agree.
Yes, I think we're talking about the same thing.

In retrospect, "top-level" is ambiguous. "Upstream" and "downstream" may be as well. Within git-branch(1), the phrase "upstream" refers to the remote tracking branch set by

     git branch --set-upstream-to=<upstream>
git-merge(1) is consistent with this.
     "If no commit is given from the command line, merge the
      remote-tracking branches that the current branch is
      configured to use as its upstream."

git-subtree.sh doesn't really deal in "upstreams" in the git-branch or git-merge sense.

Less ambiguous language is available:

For merge commits, there is the "first parent" and "second parent" (or 3rd or higher parents).

For trees, there is the "root tree" and "sub-trees," like `git ls-tree -r`
     -r     Recurse into sub-trees.

Both of these deliberately ignore the dependency relationship between the various projects and branches in question, which can potentially get messy.

Show 9 quoted lines
>>> +	if git rev-parse --verify -q "$rev:$config"; then
>>
>> For subtree split, should we also test for this file in tree you are
>> splitting: i.e., "$dir/$config"? The answer might be no.
> 
> You're right that we should consider this question.  The answer is:
> no, we should not.  Briefly, whether to use the new or old algorithms
> depends on whether the downstream has adopted the new git-subtree, not
> on whether the upstream has added some optional config.
Very well-reasoned; I like it.

Let me ask this question in a slightly different way: does RIIR subtree honor config files in locations other than the one you test for above? That's

     ${rev}:.git-subtree/config

which is `.git-subtree/config` within the root tree of the rev that is being manipulated?

If this is the only config file RIIR subtree honors, the patch is probably correct. If RIIR subtree honors config from other places, such as

* the working tree
* HEAD:.git-subtree/config
* HEAD:./.git-subtree/config
then consider testing for those if appropriate.
Show 7 quoted lines
>> Subtree merges can be performed without git-subtree, via the `-X
>> subtree` merge strategy option.
> 
> 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.
Thanks for looking at this.
> Combining manual -X subtree merges with git-subtree --squash merges
> could easily produce quite weird and wrong results in the tree

I haven't tried it, but I think if --squash is in use, then attempting an unmarked subtree merge will probably die with "unrelated history" warnings.

Looking forward to v2,
Colin
Previous: Phillip WoodNext: Ian Jackson
Message 9 of 20 in “git-subtree: Bail out if we find output from Rust rewrite”
  1. 0/2 git-subtree: Bail out if we find output from Rust rewriteIan Jackson, Jul 6, 2026
  2. 1/2 git-subtree: Bail out if we find output from Rust rewriteIan Jackson, Jul 6, 2026
  3. Junio C HamanoJul 6, 2026
  4. Ian JacksonJul 6, 2026
  5. Junio C HamanoJul 6, 2026
  6. Colin StagnerJul 9, 2026
  7. Ian JacksonJul 9, 2026
  8. Phillip WoodJul 9, 2026
  9. Colin StagnerJul 9, 2026
  10. Ian JacksonJul 10, 2026
  11. Colin StagnerJul 15, 2026
  12. D. Ben KnobleJul 11, 2026
  13. Ian JacksonJul 11, 2026
  14. Junio C HamanoJul 11, 2026
  15. Colin StagnerJul 11, 2026
  16. Ian JacksonJul 12, 2026
  17. Junio C HamanoJul 12, 2026
  18. Junio C HamanoAug 26, 2026
  19. 2/2 git-subtree: Bail out if we find output from Rust rewrite (test)Ian Jackson, Jul 6, 2026
  20. Colin StagnerJul 9, 2026

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.