git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bingwu Zhang <xtex@envs.net>
To: Junio C Hamano <gitster@pobox.com>, apenwarr@gmail.com
Cc: git@vger.kernel.org
Subject: Re: [PATCH] contrib/subtree: verify HEAD is valid before adding a subtree
Date: Tue, 11 Feb 2025 09:13:26 +0800	[thread overview]
Message-ID: <12606159.O9o76ZdvQC@xtex1> (raw)
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!

> 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




      reply	other threads:[~2025-02-11  1:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10  2:11 [PATCH] contrib/subtree: verify HEAD is valid before adding a subtree Bingwu Zhang
2025-02-10 16:28 ` Junio C Hamano
2025-02-11  1:13   ` Bingwu Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12606159.O9o76ZdvQC@xtex1 \
    --to=xtex@envs.net \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).