Re: push.default: current vs upstream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 April 2012 22:40, Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote:
> Junio C Hamano <gitster@xxxxxxxxx> writes:
>
>> No more words from me on this subthread.
>
> It's a pity. I still have no answer to my question:
>
> | But why doesn't the same applies to "git pull"? Why would it be natural
> | for "git pull" to pull from a branch other than the one with the same
> | name?

The choice of "fetch" and "pull" and "push" were in some respects
unfortunate. They sound like opposites, but they are not. The very
fact that you have two commands "pull" and "fetch" both of which are
more or less the semantic opposites of "push" leads to confusion.

And actually I find your use of "git pull" and "pull" in the
expression "pull from a branch other than one with the same name"
confusing. Barring misconfiguration pull operates on only one local
branch and it is usually the one with the same name. However push
operates on multiple local branches. So from the point of view of
"what local branches are involved in the operation" the current
default leads to inconsistency.

If you had replaced "pull" with "fetch" then your argument somewhat
makes sense, but IMO is overriden by the observation that "fetch" is
essentially non-destructive, it modifies only local copies of the
remotes state, and even if you consider that destructive it is
destructive of your own data , push on the other hand *is* potentially
destructive, and destructive of data on a remote system.

Lastly I have never really encountered any confusion with explaining
the default behaviour of git-fetch, nor actually git-pull, but I have
encountered lots of confusion of people using git-push.  They expect
git-push to be the opposite of git-pull not git-fetch.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]