git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Pull is Mostly Evil

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 2, 2014, 20:58 UTC
Message-ID
<53640701f135a_135215292ec1@nysa.notmuch>
In-Reply-To
<xmqqtx989c9d.fsf@gitster.dls.corp.google.com>
Junio C Hamano wrote:
Show 13 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> >> Stepping back even further, and thinking what is different between
> >> these two pulls, we notice that the first one is pulling from the
> >> place we push back to.  Perhaps a way to solve this issue, without
> >> having to introduce a new 'git update' and updating the tutorials,
> >> may be disallow fetch+merge by default only when pulling from the
> >> place the result is going to be pushed back to?
> >
> > Which is basically essentially the same as not specifying anything, or
> > rather, running `git pull` without arguments.
> 
> I cannot tell if you are agreeing or disagreeing, and with what.

I'm agreeing that 'git pull repo branch' is different than 'git pull', and 'git pull' is the problem. I'm not certain about 'git pull repo', but I think that probably shouldn't change either.

> Using the "special case 'git pull' without arguments" heuristics
> would take us back to the old jc/pull-training-wheel patch
> 
>     http://thread.gmane.org/gmane.comp.version-control.git/225146/focus=230856

If you mean adding back the 'test $# = 0', then yes, if you mean going back to 'pull.rebase=false' to force merges (and a bunch of other stuff), then no.

Show 6 quoted lines
> which we agreed to drop in
> 
>     http://thread.gmane.org/gmane.comp.version-control.git/233554/focus=234365
> 
> to favor the old series you did with pull.mode, and we rejected that
> patch in $gmane/230856 for a sound reason, I would think.
Because the 'pull.mode=merge' mode option was simply sensible.
Show 15 quoted lines
> "You are pulling from the place the result is going to be pushed
> back to" is different from "'git pull' was run without arguments".
> In the "pumpking" example in the message you are responding to:
> 
>     When he becomes in charge of producing a new 'maint' (in his
>     original, he says 'maintenance-branch'), he first does this:
> 
>         $ git checkout maint
>         $ git pull --ff-only [ origin maint ]
> 
> the heuristics would trigger the safety only when the optional
> "origin maint" are not given, but we do have enough information
> to see "git pull origin maint" (with where from and what to pull
> explicitly specified on the command line) falls into the case where
> the user needs protection, don't we?

I think 'git pull' and 'git pull origin maint' are different, regardless of the fact that origin/maint is the upstream.

In the former I would expect 'maint' to be merged to 'origin/maint', in
the latter I would expect 'origin/maint' to be merged into 'maint'. And
if the user has specified that he wants to merge 'origin/maint' into
'maint', I don't see why a non-fast-forward should fail.
 
> Also, with the triangular push configuration, "git pull" without
> argument will fetch from one place that is different from where the
> current branch is going to pushed to, so that heuristics would not
> work at all.

I think that's irrelevant. Both the upstream and publish tracking branches don't matter when the user has specifically asked for a branch to be pulled.

-- 
Felipe Contreras
Previous: Junio C HamanoNext: Jeff King
Message 16 of 50 in “Pull is Mostly Evil”
  1. Marc BranchaudMay 2, 2014
  2. David KastrupMay 2, 2014
  3. Philip OakleyMay 2, 2014
  4. Felipe ContrerasMay 2, 2014
  5. Philip OakleyMay 2, 2014
  6. Jonathan NiederMay 2, 2014
  7. Philip OakleyMay 3, 2014
  8. Felipe ContrerasMay 2, 2014
  9. Philip OakleyMay 3, 2014
  10. Felipe ContrerasMay 3, 2014
  11. David LangMay 2, 2014
  12. David KastrupMay 2, 2014
  13. Junio C HamanoMay 2, 2014
  14. Felipe ContrerasMay 2, 2014
  15. Junio C HamanoMay 2, 2014
  16. Felipe ContrerasMay 2, 2014
  17. Jeff KingMay 2, 2014
  18. Felipe ContrerasMay 2, 2014
  19. Jeff KingMay 2, 2014
  20. Felipe ContrerasMay 2, 2014
  21. David KastrupMay 3, 2014
  22. Junio C HamanoMay 6, 2014
  23. Felipe ContrerasMay 6, 2014
  24. Richard HansenMay 3, 2014
  25. David KastrupMay 3, 2014
  26. Felipe ContrerasMay 3, 2014
  27. David KastrupMay 3, 2014
  28. David LangMay 4, 2014
  29. Felipe ContrerasMay 4, 2014
  30. David KastrupMay 4, 2014
  31. James DenholmMay 4, 2014
  32. David KastrupMay 4, 2014
  33. Felipe ContrerasMay 4, 2014
  34. James DenholmMay 4, 2014
  35. David KastrupMay 4, 2014
  36. Felipe ContrerasMay 3, 2014
  37. Richard HansenMay 3, 2014
  38. Felipe ContrerasMay 4, 2014
  39. Richard HansenMay 4, 2014
  40. Felipe ContrerasMay 4, 2014
  41. Richard HansenMay 4, 2014
  42. Felipe ContrerasMay 4, 2014
  43. Richard HansenMay 5, 2014
  44. Felipe ContrerasMay 5, 2014
  45. Max KirillovMay 7, 2014
  46. John SzakmeisterMay 3, 2014
  47. Richard HansenMay 5, 2014
  48. Felipe ContrerasMay 5, 2014
  49. Philip OakleyMay 2, 2014
  50. Marc BranchaudMay 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.