Subject: Re: push.default: current vs upstream

From: Junio C Hamano <[email-masked]>
Date: Mon, 02 Apr 2012 11:40:04 -0700

Matthieu Moy <[email-masked]> writes:

> Junio C Hamano <[email-masked]> writes:
>
>> Before saying "again", perhaps we should read and think about what the
>> other side said.  I think [*1*] raises a good point.
>
>> *1* http://thread.gmane.org/gmane.comp.version-control.git/194175/focus=194470
>
> I think this message precisely supports my claim: we focus the
> discussion on "git push", without thinking on the big picture "git pull"
> AND "git push". The message you point to does not talk at all about "git
> pull".

I do not think so; that "name" argument is about this part from Peff's
message, to which it is a response:

>> > my two concerns is that this:
>> >
>> >   $ git clone ...
>> >   $ git checkout -b topic origin/master
>> >   $ hack hack hack
>> >   $ git push
>> >
>> > will try to implicitly fast-forward merge your commits onto master.
>> 
>> And the reason why it is surprising to the beginners is?  Because "topic"
>> and "master" (of "origin/master") are not the same name?
>
> Sort of. It is more because "upstream" is an overloaded concept. Perhaps
> you created the branch from origin/master because you wanted to say
> "this is where my topic is based, and when I 'rebase -i' later, I want
> it to be considered the baseline". Or perhaps you meant to say "I am
> going to work on origin's master branch, but I would prefer to call it
> 'topic' here".

If you re-read it, it should be clear that this is _also_ about "git pull";
"I am going to work on origin's master branch" is about pushing the result
back there.

In the former case, you may want to push it to 'topic' to work further
with your collaborators.  In the latter case, you would want to push it
back to 'master', even though you are calling it locally 'topic' for some
sick reason (read: because you can).