git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:08 UTC

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

From
IJIan Jackson <ijackson@chiark.greenend.org.uk>
Date
Jul 6, 2026, 15:03 UTC
Message-ID
<27211.50096.133710.528147@chiark.greenend.org.uk>
In-Reply-To
<xmqqy0fob2kl.fsf@gitster.g>
Hi.  Thanks for the quick review.
Junio C Hamano writes ("Re: [PATCH 1/2] git-subtree: Bail out if we find output from Rust rewrite"):
> If (global) $rev is not set here, we'd check :.git-subtree/config in
> the index in order to detect the v2's configuration.  It seems to me
> that this code however wants to inspect HEAD's tree.

This was a slip. The code in reject_if_v2_config is supposed to use its argument (as per the usage comment I added), not a global. I'll fix this with a respin.

(I think it may somehow work by accident in my tests.)
> The above helper may work for one caller that passes "$rev" but not
> for the other caller that passes "HEAD", no?

HEAD is a valid revision spec for git-rev-parse, but the function should use $1 (which in that case would be HEAD), not $rev.

Show 7 quoted lines
> 	if git rev-parse --verify -q "$1:$config"
> 	then
> 		die "fatal: tree contains $config: has been processed with new standalone (Rust) git-subtree; use that tool instead of this one.  See https://codeberg.org/diziet/git-subtree https://crates.io/crates/git-subtree"
> 	fi
> 
> Overly long output does not look very easy to read, but I kept it
> the same as the original.

I'm not a great fan of the long error message myself, but it seemed to be what the rest of the script was doing. I didn't find any multi-line calls to die, so that's why I did it this way.

I'm happy to reformat this to your taste.

Thanks, Ian.

-- 
Ian Jackson <ijackson@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 20 in “git-subtree: Bail out if we find output from Rust rewrite”
  1. 1/2 git-subtree: Bail out if we find output from Rust rewriteIan Jackson, Jul 6, 2026
  2. 2/2 git-subtree: Bail out if we find output from Rust rewrite (test)Ian Jackson, Jul 6, 2026
  3. 0/2 git-subtree: Bail out if we find output from Rust rewriteIan Jackson, Jul 6, 2026
  4. Junio C HamanoJul 6, 2026
  5. Ian JacksonJul 6, 2026
  6. Junio C HamanoJul 6, 2026
  7. Colin StagnerJul 9, 2026
  8. Colin StagnerJul 9, 2026
  9. Ian JacksonJul 9, 2026
  10. Phillip WoodJul 9, 2026
  11. Colin StagnerJul 9, 2026
  12. Ian JacksonJul 10, 2026
  13. D. Ben KnobleJul 11, 2026
  14. Ian JacksonJul 11, 2026
  15. Junio C HamanoJul 11, 2026
  16. Colin StagnerJul 11, 2026
  17. Ian JacksonJul 12, 2026
  18. Junio C HamanoJul 12, 2026
  19. Colin StagnerJul 15, 2026
  20. Junio C HamanoAug 26, 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.