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

Re: Pull is Evil

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2014, 19:10 UTC
Message-ID
<xmqq38gufxbm.fsf@gitster.dls.corp.google.com>
In-Reply-To
<5361416a172fe_f9b15012ec7e@nysa.notmuch>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 27 quoted lines
> Matthieu Moy wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>> ...
>> > Yes, this has been discussed many times in the past, and everyone agrees
>> > the default behavior is not correct.
>> 
>> You definitely have a strange notion of "everyone".
>
> Do I? Let's look at some of the discussions:
>
> http://thread.gmane.org/gmane.comp.version-control.git/225146
>
> * W. Trevor King agrees the default should change
> * Junio C Hamano agrees the default should change
> * John Keeping agrees the default should change
> * Matthieu Moy doesn't agree anything should change
> * Linus Torvalds agrees changing the default is fine
>
> http://thread.gmane.org/gmane.comp.version-control.git/233554
>
> * Richard Hansen agrees with my proposal
> * Ramkumar Ramachandra agrees with my proposal
> * Brian M. Carlson is not happy but can live with my proposal
> * Jeff King accepts my proposal is a good way to move forward
> * Matthieu Moy is OK with change, but only if the default remains the same
>
> So, by "everyone" I mean everyone but one person (you).

I looked at the latter thread and re-read what Peff wrote (added to Cc). I think the most relevant (other than solving it in quite a different way $gmane/233554) one to your version of the solution is this:

  http://thread.gmane.org/gmane.comp.version-control.git/233554/focus=234365
where he responds to my "how about this way forward" with this:
    > ... I think other people are also in
    > agreement. So perhaps:
    > 
    >  - drop jc/pull-training-wheel and revert its merge from 'next';
    > 
    >  - update Felipe's series with a bit of tweak to make it less
    >    impactful by demoting error into warning and advice.
    > 
    > would be a good way forward?
    I think that would address the concern I raised, because it does not
    create a roadblock to new users accomplishing their task. They can
    ignore the warning, or choose "merge" as the default to shut up the
    warning (and it is easy to choose that if you are confused, because
    it is what git is doing by default alongside the warning).

While I do not quite see the previous discussion as deciding the particular implementation is good without further tweaks, I would say that everybody agrees that the default behaviour is not good for everybody and therefore should (or for Linus, "it is OK to") change.

> Rational people don't think in absolute terms, "everyone" means
> virtually everyone, which is the case.

True for "should change", not virtually everyone for "should change with that particular solution".

But after re-reading the series description 0/n this round in the other thread, I think the overall direction is good (just like Peff said in the previous thread), especially if there is a warning not error period.

The step (I am not sure you have it in your series or not, but I would strongly recommend adding one if it doesn't yet) that gives a "will change the default, and here is how to configure" warning when we see an actual merge made (or rebased) after "git pull" without "--merge/--rebase" is not just a way to prepare existing users, but is a good way to bring new goodness to newbies. The session might go like this:

	$ git pull
        ... fetching ...
        ... merging ...
        ... diffstat ...
        warning: you merged the $branch from $remote into your
        warning: work, which may not be what you wanted to do unless
        warning: you are acting as a project integrator.  If that is
        warning: the case, "git config --set pull.mode ff-only" to
        warning: cause "git pull" to refuse working when it does not
        warning: fast-forward.  Use pull.mode=merge if you did mean
        warning: it, to squelch this message.

I am not advocating the exact wording above, but am illustrating that there is a place for us to tell the new people to live in a better future before the switchover happens.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 66 of 73 in “A failing attempt to use Git in a centralized environment”
  1. Marat RadchenkoApr 28, 2014
  2. Junio C HamanoApr 28, 2014
  3. Pull is Evil (was: Re: A failing attempt to use Git in a centralized environment)Marc Branchaud, Apr 30, 2014
  4. Junio C HamanoApr 30, 2014
  5. Marc BranchaudApr 30, 2014
  6. Jonathan NiederApr 30, 2014
  7. Junio C HamanoApr 30, 2014
  8. Marc BranchaudApr 30, 2014
  9. Andreas KreyMay 2, 2014
  10. David KastrupMay 2, 2014
  11. Andreas KreyMay 3, 2014
  12. David KastrupMay 3, 2014
  13. Felipe ContrerasApr 30, 2014
  14. Marc BranchaudApr 30, 2014
  15. Felipe ContrerasApr 30, 2014
  16. brian m. carlsonMay 1, 2014
  17. Felipe ContrerasMay 1, 2014
  18. Junio C HamanoMay 1, 2014
  19. Felipe ContrerasMay 1, 2014
  20. W. Trevor KingMay 1, 2014
  21. W. Trevor KingMay 1, 2014
  22. Felipe ContrerasMay 1, 2014
  23. W. Trevor KingMay 2, 2014
  24. Felipe ContrerasMay 2, 2014
  25. W. Trevor KingMay 2, 2014
  26. Felipe ContrerasMay 2, 2014
  27. W. Trevor KingMay 2, 2014
  28. Felipe ContrerasMay 2, 2014
  29. W. Trevor KingMay 2, 2014
  30. David KastrupMay 2, 2014
  31. Felipe ContrerasMay 2, 2014
  32. W. Trevor KingMay 2, 2014
  33. Felipe ContrerasMay 2, 2014
  34. W. Trevor KingMay 2, 2014
  35. Felipe ContrerasMay 2, 2014
  36. pull.prompt or other way to slow/disable 'git pull' (was: Pull is Evil)W. Trevor King, May 2, 2014
  37. Felipe ContrerasMay 2, 2014
  38. W. Trevor KingMay 3, 2014
  39. Felipe ContrerasMay 3, 2014
  40. W. Trevor KingMay 4, 2014
  41. Felipe ContrerasMay 4, 2014
  42. Felipe ContrerasMay 1, 2014
  43. Marc BranchaudMay 1, 2014
  44. W. Trevor KingMay 1, 2014
  45. Marc BranchaudMay 1, 2014
  46. W. Trevor KingMay 1, 2014
  47. Marc BranchaudMay 1, 2014
  48. Felipe ContrerasMay 1, 2014
  49. Andreas KreyMay 2, 2014
  50. Felipe ContrerasMay 2, 2014
  51. Junio C HamanoMay 2, 2014
  52. Junio C HamanoMay 2, 2014
  53. brian m. carlsonMay 1, 2014
  54. Felipe ContrerasMay 1, 2014
  55. Felipe ContrerasMay 1, 2014
  56. Marc BranchaudMay 1, 2014
  57. Felipe ContrerasMay 1, 2014
  58. Philip OakleyMay 1, 2014
  59. Philip OakleyMay 1, 2014
  60. Felipe ContrerasMay 1, 2014
  61. W. Trevor KingMay 1, 2014
  62. Felipe ContrerasMay 2, 2014
  63. Felipe ContrerasApr 30, 2014
  64. Matthieu MoyApr 30, 2014
  65. Felipe ContrerasApr 30, 2014
  66. Junio C HamanoApr 30, 2014
  67. Felipe ContrerasApr 30, 2014
  68. Junio C HamanoApr 30, 2014
  69. Felipe ContrerasApr 30, 2014
  70. Stepan KasalApr 30, 2014
  71. Geert BoschApr 30, 2014
  72. John SzakmeisterMay 4, 2014
  73. Max KirillovMay 2, 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.