Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:27

Tay Ray Chuan [off-list ref] writes:
quoted
+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".
quoted
+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.
quoted
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.)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help