Subject: Re: Pull is Evil

From: Junio C Hamano <[email-masked]>
Date: Fri, 02 May 2014 12:53:45 -0700

Junio C Hamano <[email-masked]> writes:

> Marc Branchaud <[email-masked]> writes:
>
>> I may be mistaken, but I think "git pull" evolved to try to address the
>> detached-HEAD risk (at least in part).
>
> You are totally mistaken.
>
> "git pull" was part of the things to make git usable by Linus before
> 1.0 release, and matches the integrator workflow perfectly well.
> The detached HEAD came much much later.
>
> The issue we are discussing with "git pull" is that if a non
> integrator does a "git pull" from the upstream, in order to push the
> result of integrating the local work with it back to the upstream,
> by default "git pull" creates a merge in a direction that is wrong
> when seen in the "first-parent chain is the trunk" point of view.
>
> One way to solve that _might_ be to use the detached HEAD as you
> illustrated in your long-hand in the thread that had Brian's
> example, but that is not even a failed 'git push' recommends to do
> to the users, and there was no link between how 'git pull' behaves
> and use of detached HEAD at all.

One other thing to keep in mind is that the "first-parent" view
itself is fairly new, compared to "git pull" (and it is even newer
than detached HEAD IIRC, but I do not think detached HEAD has much
to do with the current "'git pull' is often harmful" confusion,
except that it may be one ingredient for a possible solution).

Back when we started "A simple CVS/SVN like workflow can be done by
cycles of 'git pull', do your work, 'git push'", the order of
parents in resulting merges was not an issue.

I am only saying these to give people the historical background to
discuss a possible solution.  I am not saying that it is a possible
solution to discourage the "first-parent chain is the mainline of
the development" world view.