Re: [RFC PATCH] push: start warning upcoming default change for push.default
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:17
Matthieu Moy [off-list ref] writes:
* 'upstream' makes "git push" and "git pull" symmetrical. While there are workflows where it is usefull to have "push" and "pull" point to different branches, I think it is far more intuitive to have this symmetry by default.
Yes, "by default" is really the key word in this discussion, and I find the above a sound reasoning.
... That being said, I think the mode you Michael described at least deserves to exist, even if I disagree that it would be the best default.
While I agree with that, I think the "if and only if the destination
already exists" falls into the same "modifier" category as "force"
that changes the behaviour of updating _one_ ref from the default
"only if it fast-forwards" to "even if it does not fast-forward". I
would prefer this new modifier not to be tied too tightly to the
Michael's magic mode, so that it can also be used when the refspecs
are explicitly given.
In other words, with "force":
git push $there +pu
updates branch 'pu' over there even if it is not an ancestor of our
'pu'. Similarly, may want to be able to say (I am *not* suggesting
to use '?' as the motifier):
git push $there ?next
to update next only if it exists over there and it is an ancestor of
our 'next'.
Maybe these modifiers can be combined, so that I can say
for there in k.org repo github sf.net
do
git push $there maint master ?next ?+pu
done
Because the publishing point I have at sourceforge lack next and pu,
this will only update maint and master following the usual rules
over there, but next and pu will be updated at other places.
Hmm?