Re: [PATCH v2.5 2/2] tag: prevent nested tags
- From
Jeff King <peff@peff.net>
- Date
- Apr 4, 2019, 22:12 UTC
- Message-ID
- <20190404221208.GA30798@sigill.intra.peff.net>
- In-Reply-To
- <xmqqef6he8sh.fsf@gitster-ct.c.googlers.com>
On Fri, Apr 05, 2019 at 06:54:06AM +0900, Junio C Hamano wrote:
Show 20 quoted lines
> Jeff King <peff@peff.net> writes:
>
> > but you have to take pretty specific steps to get a tag of a blob or
> > tree, like:
> >
> > git tag mytag HEAD:path
> >
> > or
> >
> > git tag mytag HEAD^{tree}
>
> And the way to ask for commit and tag are
>
> git tag mytag master
> git tag mytag v1.0.0
>
> I do not see why only the last one should either be forbidden or
> automaticallly peel. Each of these four names an object of a
> specific type, and singling out a tag as "curious" makes the
> interface uneven.My point is that it's easy to accidentally tag a tag. It's not easy to accidentally tag a tree. The counter example would be something that looks as easy as your "git tag mytag v1.0.0" but actually tags a tree. I couldn't think of one.
I do buy the argument that arguing for safety valves from a point of "what's the easiest mistake to make in our current interface" might not be the best one. It yields a set of operations that aren't necessarily sensible or orthogonal with respect to the underlying reality of what's possible and what's reasonable. Which I think is the point you're making.
-Peff