Re: [PATCH] contrib/subtree: verify HEAD is valid before adding a subtree
- From
- Bingwu Zhang <xtex@envs.net>
- Date
- Feb 11, 2025, 01:13 UTC
- Message-ID
- <12606159.O9o76ZdvQC@xtex1>
- In-Reply-To
- <xmqq8qqddarl.fsf@gitster.g>
On Tuesday, February 11, 2025 12:28:46 AM GMT+8 Junio C Hamano wrote:
> In short, "is not" -> "may not be", perhaps?
Yes, thank you!
Show 7 quoted lines
> And if we want to treat an unborn HEAD equivalent to an empty tree, > then dying upon seeing "show-ref" fail would not be a good solution > to the problem, no? Shouldn't the updated logic to deal with an > unborn HEAD be more like "if we see that the HEAD is unborn, then we > are happy iff the index is empty; if HEAD already points at a > commit, then we are happy iff the working tree has no changes > relative to it"?
I did consider treating an unborn HEAD as a empty tree and test if index is empty. However I searched and failed to find out a git subcommand to do that test (: Do you have any suggestions?
-- Bingwu Zhang xtex @ Tue, 11 Feb 2025 01:10:17 +0000