git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Feature request: Add --no-edit to git tag command

From
Jeff King <peff@peff.net>
Date
Apr 5, 2019, 22:21 UTC
Message-ID
<20190405222100.GA10787@sigill.intra.peff.net>
In-Reply-To
<CAHd499CUCoShsQHYZotFqprfDUf_owg_Urbt29fkNRV6LhFc3Q@mail.gmail.com>
On Thu, Apr 04, 2019 at 08:56:16AM -0500, Robert Dailey wrote:
Show 7 quoted lines
> > I was thinking it was just the --no-edit fix. :) Even with the "--amend"
> > thing, though, it's probably a little light for a 3-month-long GSoC
> > project. :)
> 
> I apologize for the confusion. I'm not fully aware of any per-option
> philosophies in Git, so I may be unaware of the misunderstanding my
> request is causing. Let me attempt to clarify.
I think most of the confusion was just bad reading on my part. :)
Show 19 quoted lines
> My goal as a user is to correct a tag. If I point a tag at the wrong
> commit, I simply want to move that tag to point to another commit. At
> the moment, the only way I know to do this is the -f option, which I
> just treat as a "move" for the tag. I realize that may not be its
> intent in the implementation, but from a user perspective that's the
> end result I get.
> 
> So if I treat -f as a "move this tag", I also want to say "reuse the
> existing commit message". So again, in my mind, that means -f
> --no-edit. Which means "I'm moving this tag and I want to keep the
> previous commit message".
> 
> I hope this makes more sense. If getting this means not using -f or
> --no-edit at all, and is instead a whole different set of options, I'm
> OK with that as long as the end result is achievable. It's impossible
> to write a script to "move" (-f) a bunch of annotated tags without an
> editor prompting me on each one. So this "--no-edit" addition would
> assist in automation, and also making sure that we simply want to
> correct a tag, but not alter the message.

Yeah, I think what you want to do is perfectly reasonable. The only reason not to use "-f" is because it already means other things, and we don't want to overload it. Calling it "--amend" would make perfect sense (and then fixing "--no-edit" so it lets you avoid opening the editor). So I think there are two bits of work:

  1. Add an "--amend" option, which allows overwriting an existing tag
     and pre-populates the message with the existing tag's message.
  2. Make --no-edit work like the patch I showed earlier (assuming that
     your --amend still opens an editor by default).
-Peff
Previous: Robert DaileyNext: Bárbara de Castro Fernandes
Message 7 of 13 in “Feature request: Add --no-edit to git tag command”
  1. Robert DaileyApr 3, 2019
  2. Jeff KingApr 4, 2019
  3. Taylor BlauApr 4, 2019
  4. Jeff KingApr 4, 2019
  5. Robert DaileyApr 4, 2019
  6. Robert DaileyApr 4, 2019
  7. Jeff KingApr 5, 2019
  8. Bárbara de Castro FernandesApr 11, 2019
  9. Jeff KingApr 11, 2019
  10. Junio C HamanoApr 12, 2019
  11. Jeff KingApr 12, 2019
  12. Junio C HamanoApr 4, 2019
  13. Jeff KingApr 4, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.