git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Robert Dailey <rcdailey.lists@gmail.com>, Git <git@vger.kernel.org>
Subject: Re: Feature request: Add --no-edit to git tag command
Date: Thu, 4 Apr 2019 08:01:08 -0400	[thread overview]
Message-ID: <20190404120108.GA22324@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqo95mf80j.fsf@gitster-ct.c.googlers.com>

On Thu, Apr 04, 2019 at 06:13:16PM +0900, Junio C Hamano wrote:

> >> Similar to git commit, it would be nice to have a --no-edit option for
> >> git tag. Use case is when I force-recreate a tag:
> >> 
> >> $ git tag -af 1.0 123abc
> >> 
> >> An editor will be prompted with the previous annotated tag message. I
> >> would like to add --no-edit to instruct it to use any previously
> >> provided message and without prompting the editor:
> >> 
> >> $ git tag --no-edit -af 1.0 123abc
> >
> > Yeah, that sounds like a good idea.
> 
> I am not so sure this is a good idea, especially if the plan is to
> do this alone without necessary associated change to make things
> consistent.

I think I may have misunderstood the request.

I thought it was "we already do this re-use the tag message thing, but
--no-edit is broken". And the proposal was to fix --no-edit. Which is
definitely broken, and it seems like a no-brainer to fix.

But looking at the code, yeah, I see that we do not do that. The
proposal is to implement both halves. And...

> The part that bothers me most is use of "-f".  The mentalitly behind
> "-f" is "I am creating a new and tag that is totally unrelated to
> any existing tag, but since the command refuses to reuse the ref to
> point at my new tag, I am giving an '-f' to force (1) unpointing the
> existing unrelated tag and (2) pointing the enwly created tag with
> that tagname".
> 
> The proposed change still uses "-f" but wants to somehow take the
> tag message from the unrelated tag that happens to sit at the same
> place as the new tag wants to go.  That breaks the mental model a
> big way.
> 
> If this were a new option that is spelled "--amend", I won't
> be complaining, though.

Yes, I agree with all of this. Calling it "--amend" is much better
(and/or adding the equivalent of "commit -c" to pick up the message from
an existing tag, though maybe "--amend existing-name new-target" would
be enough to repoint a tag with the same name).

-Peff

      reply	other threads:[~2019-04-04 12:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 14:38 Feature request: Add --no-edit to git tag command Robert Dailey
2019-04-04  1:57 ` Jeff King
2019-04-04  3:26   ` Taylor Blau
2019-04-04 12:06     ` Jeff King
2019-04-04 13:56       ` Robert Dailey
2019-04-04 13:57         ` Robert Dailey
2019-04-05 22:21         ` Jeff King
2019-04-11 18:20           ` Bárbara de Castro Fernandes
2019-04-11 18:29             ` Jeff King
2019-04-12  2:32               ` Junio C Hamano
2019-04-12  2:33                 ` Jeff King
2019-04-04  9:13   ` Junio C Hamano
2019-04-04 12:01     ` Jeff King [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=20190404120108.GA22324@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rcdailey.lists@gmail.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).