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

Re: [PATCH] tag: --force is quiet about new tags

From
Phil Hord <phil.hord@gmail.com>
Date
Mar 13, 2013, 04:21 UTC
Message-ID
<CABURp0oT8ZN5fKtKh67Gm1P5rf_a3diqcYbw8mUga-gv5MPu6Q@mail.gmail.com>
In-Reply-To
<7vy5ds3re0.fsf@alter.siamese.dyndns.org>
On Tue, Mar 12, 2013 at 11:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> Phil Hord <hordp@cisco.com> writes:
>
>> git tag --force is used to replace an existing tag with
>> a new reference.  Git helpfully tells the user the old
>> ref when this happens.  But if the tag name is new and does
>> not exist, git tells the user the old ref anyway (000000).
>>
>> Teach git to ignore --force if the tag is new.  Add a test
>> for this and also to ensure --force can replace tags at all.
>>
>> Signed-off-by: Phil Hord <hordp@cisco.com>
>> ---
>
> I think we would still want to allow the operation to go through,
> even when the --force option is given, to create a new tag.  I agree
> that the message should not say "Updated".  So teaching Git not to
> issue the "Updated" message makes perfect sense.  It is somewhat
> misleading to say we are teaching Git to ignore the option, though.
>
> Thanks.

My phrasing was too ambiguous. What you described is exactly what the patch does. --force is superfluous when the tag does not already exist. It is only checked in two places, and one of those is to decide whether to print the "Updated" message. How's this?

   Teach 'git tag --force' to suppress the update message if
   the tag is new.  Add a test for this and also to ensure
   --force can replace tags at all.
Phil
Previous: Junio C HamanoNext: Michael J Gruber
Message 3 of 4 in “tag: --force is quiet about new tags”
  1. tag: --force is quiet about new tagsPhil Hord, Mar 12, 2013
  2. Junio C HamanoMar 13, 2013
  3. Phil HordMar 13, 2013
  4. Michael J GruberMar 13, 2013

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.