Require "-f" for push to update a tag, even if it is a fast-forward.
* cr/push-force-tag-update:
push: allow already-exists advice to be disabled
push: rename config variable for more general use
push: cleanup push rules comment
push: clarify rejection of update to non-commit-ish
push: require force for annotated tags
push: require force for refs under refs/tags/
push: flag updates that require force
push: keep track of "update" state separately
push: add advice for rejected tag reference
push: return reject reasons as a bitset
@ -51,10 +51,11 @@ be named. If `:`<dst> is omitted, the same ref as <src> will be
@@ -51,10 +51,11 @@ be named. If `:`<dst> is omitted, the same ref as <src> will be
updated.
+
The object referenced by <src> is used to update the <dst> reference
on the remote side, but by default this is only allowed if the
update can fast-forward <dst>. By having the optional leading `+`,
you can tell git to update the <dst> ref even when the update is not a
fast-forward. This does *not* attempt to merge <src> into <dst>. See
on the remote side. By default this is only allowed if <dst> is not
a tag (annotated or lightweight), and then only if it can fast-forward
<dst>. By having the optional leading `+`, you can tell git to update
the <dst> ref even if it is not allowed by default (e.g., it is not a
fast-forward.) This does *not* attempt to merge <src> into <dst>. See
EXAMPLES below for details.
+
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
@ -257,7 +268,7 @@ static int push_with_options(struct transport *transport, int flags)
@@ -257,7 +268,7 @@ static int push_with_options(struct transport *transport, int flags)
if (verbosity > 0)
fprintf(stderr, _("Pushing to %s\n"), transport->url);
error(_("failed to push some refs to '%s'"), transport->url);
@ -265,18 +276,15 @@ static int push_with_options(struct transport *transport, int flags)
@@ -265,18 +276,15 @@ static int push_with_options(struct transport *transport, int flags)
if (!err)
return 0;
switch (nonfastforward) {
default:
break;
case NON_FF_HEAD:
if (reject_reasons & REJECT_NON_FF_HEAD) {
advise_pull_before_push();
break;
case NON_FF_OTHER:
} else if (reject_reasons & REJECT_NON_FF_OTHER) {
if (default_matching_used)
advise_use_upstream();
else
advise_checkout_pull_push();
break;
} else if (reject_reasons & REJECT_ALREADY_EXISTS) {
@ -720,6 +725,7 @@ static int push_refs_with_push(struct transport *transport,
@@ -720,6 +725,7 @@ static int push_refs_with_push(struct transport *transport,
/* Check for statuses set by set_ref_status_for_push() */
@ -695,6 +695,10 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
@@ -695,6 +695,10 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
@ -714,7 +718,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
@@ -714,7 +718,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i