On Mon, Apr 15, 2013 at 12:20:32AM -0700, Junio C Hamano wrote:
> Johannes Sixt <j.s...@viscovery.net> writes:
> 
> > User says:
> >
> >    git push -- master docs release
> >
> > Then git pushes the three branches to three different upstreams. You find
> > that confusing. Do I understanding correctly so far?
> 
> It is far more subtle than that.  User says that while on 'next'
> branch.
> 
> The user has been trained to think "branch.master.remote" takes
> effect while he has "master" branch checked out.
> 
> That is where the possible confusion comes from. As I said number of
> times, you may be able to declare that the confusion is unfounded
> once you think it through.

I may be an atypical user, but my expectation currently is that
branch.<name>.remote is what is used when I run "git push" with no
additional arguments.

This is probably because whenever I add additional arguments (currently)
I have to specify where I am pushing to.

So I think breaking user expectations is a red herring here because the
current behaviour means that users cannot have any expectation of what
will happen in this case.  Either you don't say anything and "git push"
DTRT for your current branch or you must specify precisely what you want
to happen (or at least the remote to use if you have push.default =
matching or remote.<name>.mirror set).

Personally I'd vote for "git push -- master" pushing to
remote.pushdefault, but I really don't know how you handle "git push --"
with the naïve implementation of that - is it the same as "git push" or
"git push $(git config remote.pushdefault)"?

On the other hand, I'm really not sure how often I'd use this feature.
Normally I just use "git push" and if I'm giving any more arguments than
that then it's for something that I don't do often enough for it to be
worth setting up configuration.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to