From: Jeff King Date: Thu, 05 Dec 2024 20:26:47 GMT Subject: Re: [PATCH 4/4] tag: "git tag" refuses to use HEAD as a tagname Message-ID: <20241205202647.GE2629822@coredump.intra.peff.net> In-Reply-To: On Tue, Dec 03, 2024 at 10:30:15AM +0900, Junio C Hamano wrote: > shejialuo writes: > > >> int check_tag_ref(struct strbuf *sb, const char *name) > >> { > >> - if (name[0] == '-') > >> + if (name[0] == '-' || !strcmp(name, "HEAD")) > > > > I am wondering whether we should also update "check_refname_format" > > function to report "refs/heads/HEAD" and "refs/tags/HEAD" is bad ref > > name. > > Check the list archive for the past few days; it was considered and > rejected. Agreed, but maybe that is an indication we should discuss that alternative in the commit message. (I had looked for similar justification in the existing "branch" restriction, but couldn't find it, to the point that I wondered if I had hallucinated our reasoning back then). -Peff