From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH 6/8] check_refname_format(): add FULLY_QUALIFIED flag
Date: Tue, 30 Apr 2024 10:00:10 -0700 [thread overview]
Message-ID: <xmqqmspardk5.fsf@gitster.g> (raw)
In-Reply-To: <ZjDDa5PIxPCFzMhq@tanuki> (Patrick Steinhardt's message of "Tue, 30 Apr 2024 12:09:47 +0200")
Patrick Steinhardt <ps@pks.im> writes:
>> valid. E.g., validating a refspec may involve a name like "main" on its
>> own. I suspect it would be OK in practice to just give it an arbitrary
>> "refs/foo/$main", but that feels kind of hacky.
>
> Ah, fair enough.
I actually do not think it is fair enough. Why does the caller want
to validate "main" in the first place? To make the example more
realistic, lets imagine a caller wants to validate "HEAD". We can
say "it is syntactically correct", but in what context is that
answer useful? If the caller is contemplating to create a new
branch given a short-name, we would want to say "no, refs/heads/HEAD
is not something we want you to create", but if the caller is
planning to create refs/remotes/origin/HEAD, our answer would be
different.
prev parent reply other threads:[~2024-04-30 17:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 8:33 [PATCH 6/8] check_refname_format(): add FULLY_QUALIFIED flag Jeff King
2024-04-29 16:01 ` Karthik Nayak
2024-04-30 9:47 ` Jeff King
2024-04-30 10:05 ` Patrick Steinhardt
2024-04-30 4:54 ` Patrick Steinhardt
2024-04-30 10:01 ` Jeff King
2024-04-30 10:09 ` Patrick Steinhardt
2024-04-30 17:00 ` Junio C Hamano [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=xmqqmspardk5.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).