From: Jeff King <peff@peff.net>
To: Kristoffer Haugsbakk <code@khaugsbakk.name>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] object-name: don't allow @ as a branch name
Date: Tue, 8 Oct 2024 02:52:55 -0400 [thread overview]
Message-ID: <20241008065255.GA676291@coredump.intra.peff.net> (raw)
In-Reply-To: <9a64a58b-3d08-44b4-96a5-9031863de4f1@app.fastmail.com>
On Mon, Oct 07, 2024 at 10:56:36PM +0200, Kristoffer Haugsbakk wrote:
> > There's a bit of subtlety here which makes the term "invalid" somewhat
> > vague. The refname "refs/heads/HEAD" is allowed by plumbing, as we try
> > to maintain backwards compatibility there. So the current prohibition is
> > just within the porcelain tools: we won't allow "git branch HEAD"
> > because it's an easy mistake to make, even though you could still create
> > it with "git update-ref".
>
> Got it. Creating this one (or something like `refs/heads/HEAD` for that
> matter) is allowed by the plumbing tools. But the porcelain ones are
> blocked.
>
> Also the plumbing query `git check-ref-format --branch @` now returns
> false. Since it has to harmonize with what the branch creation
> porcelain can do.
Yeah, good point. I was thinking the existing test was purely about the
git-branch porcelain, but "check-ref-format --branch" follows the same
rules.
> > And naturally we'd want the same rules for "refs/heads/@". I think it
> > might be worth adding "...in plumbing" to the end of the subject, and/or
> > calling out this distinction in the text.
>
> Did you mean something like “disallow in porcelain”?
Oops, yes, I had it backwards. Good catch.
-Peff
next prev parent reply other threads:[~2024-10-08 6:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 20:15 [PATCH 0/3] object-name: don't allow @ as a branch name Kristoffer Haugsbakk
2024-10-07 20:15 ` [PATCH 1/3] object-name: fix whitespace Kristoffer Haugsbakk
2024-10-07 20:15 ` [PATCH 2/3] object-name: don't allow @ as a branch name Kristoffer Haugsbakk
2024-10-07 20:44 ` Jeff King
2024-10-07 20:56 ` Kristoffer Haugsbakk
2024-10-08 6:52 ` Jeff King [this message]
2024-10-08 20:37 ` Rubén Justo
2024-10-07 22:01 ` Junio C Hamano
2024-10-08 6:54 ` Jeff King
2024-10-07 20:15 ` [PATCH 3/3] t1402: exercise disallowed branch names Kristoffer Haugsbakk
2024-10-07 20:47 ` Jeff King
2024-10-07 20:37 ` [PATCH 0/3] object-name: don't allow @ as a branch name Jeff King
2024-10-07 20:40 ` Kristoffer Haugsbakk
2024-10-08 13:19 ` shejialuo
2024-10-08 14:19 ` Kristoffer Haugsbakk
2024-10-18 14:21 ` shejialuo
2024-10-08 18:17 ` Junio C Hamano
2024-10-09 12:00 ` shejialuo
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=20241008065255.GA676291@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
/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).