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

Re: [PATCH] push: warn users about updating existing tags on push

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 1, 2010, 15:18 UTC
Message-ID
<7veidd7aqo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTinn0Evi6tYMSt+FevJnFt1taQVzqhJKuiGKudOy@mail.gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
Show 8 quoted lines
>> +push.denyMovingTags::
>> +       Whether or not a user will be allowed to push a tag that already
>> +       exists on the remote for a different object.  False by default.
>
> Hmm, it's a little weird to speak of "allowing" the user to do this
> and that. Perhaps
>
> 	Whether or not a push will be allowed to proceed if a tag...

I think that is a sensible suggestion. Or even stronger "forbid updating an existing tag; defaults to false".

Show 10 quoted lines
>> +receive.denyMovingTags::
>> +       If set to true, git-receive-pack will deny an update to a tag which
>> +       already points to a different object.  Use this to prevent such an
>> +       update via a push, even if that push is forced.
>> +
>
> Perhaps
>
> 	If set to true, git-receive-pack will refuse to update to a tag to point the
> 	tag to a	different object.  Use this...
Sounds better.
Show 20 quoted lines
>> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
>> index 658ff2f..1d53e04 100644
>> --- a/Documentation/git-push.txt
>> +++ b/Documentation/git-push.txt
>> @@ -112,7 +112,10 @@ nor in any Push line of the corresponding remotes file---see below).
>>        Usually, the command refuses to update a remote ref that is
>>        not an ancestor of the local ref used to overwrite it.
>>        This flag disables the check.  This can cause the
>> -       remote repository to lose commits; use it with care.
>> +       remote repository to lose commits; use it with care.  This
>> +       flag will also allow a previously pushed tag to be updated
>> +       to point to a new commit, which is refused if
>> +       push.denyMovingTags is set to true.
>
> Perhaps
>
> 	remote repository to lose commits; use it with care.
>
> 	Note that for tags that have already been pushed and have been updated
> 	locally, \--force will not update them if push.denyMovingTags is set to true.

I don't think the change to this section is necessary, _unless_ existing mention of "remote ref" is changed to "remote branch" to exclude tags. If we wanted to say something, probably

    Note that the above applies both to branches and tags.

would be sufficient. I don't think this is a place to enumerate exceptions like this new configuration and all the other existing ones (e.g. denynonfastforwards, denycurrentbranch, denydeletecurrent etc.)

Previous: Tay Ray Chuan
Message 10 of 10 in “push: disallow fast-forwarding tags without --force”
  1. push: disallow fast-forwarding tags without --forceDave Olszewski, Aug 27, 2010
  2. Junio C HamanoAug 27, 2010
  3. Dave OlszewskiAug 27, 2010
  4. Jonathan NiederAug 28, 2010
  5. push: warn users about updating existing tags on pushDave Olszewski, Aug 28, 2010
  6. Junio C HamanoAug 30, 2010
  7. Dave OlszewskiAug 30, 2010
  8. Junio C HamanoAug 30, 2010
  9. Tay Ray ChuanSep 1, 2010
  10. Junio C HamanoSep 1, 2010

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.