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 4, 2014, 21:13 UTC
Message-ID
<5366ad66b9a6c_18f9e4b308b8@nysa.notmuch>
In-Reply-To
<53669051.6090204@bbn.com>
Richard Hansen wrote:
Show 18 quoted lines
> On 2014-05-04 06:17, Felipe Contreras wrote:
> > Richard Hansen wrote:
> >> On 2014-05-03 23:08, Felipe Contreras wrote:
> >>> It is the only solution that has been proposed.
> >>
> >> It's not the only proposal -- I proposed a few alternatives in my
> >> earlier email (though not in the form of code), and others have too.  In
> >> particular:
> >>
> >>   * create a new 'git integrate' command/alias that behaves like 'git
> >>     pull --no-ff'
> > 
> > Yeah but that's for a different issue altogheter. I doesn't solve the
> > problems in 1. nor 2. nor 3.
> 
> 'git integrate' would handle usage cases #2 (update a published branch
> to its "parent" branch) and #3 (integrate a completed task into the main
> line of development),

But these cases are completely different. One should reverse the parents, the other one not.

I feel if a new command is to be added, it should be the one that is introducing the brand new behavior: switching the parents. So it would be appropriate for 1. and 2.

Show 18 quoted lines
> >>   * change 'git pull' and 'git pull $remote [$refspec]' to do --ff-only
> >>     by default
> >>
> >> Another option that I just thought of:  Instead of your proposed
> >> pull.mode and branch.<name>.pullmode, add the following two sets of configs:
> >>
> >>   * pull.updateMode, branch.<name>.pullUpdateMode:
> >>
> >>     The default mode to use when running 'git pull' without naming a
> >>     remote repository or when the named remote branch is @{u}.  Valid
> >>     options: ff-only (default), merge-ff, merge-ff-there, merge-no-ff,
> >>     merge-no-ff-there, rebase, rebase-here, rebase-here-then-merge-no-ff
> > 
> > Those are way too many options to be able to sensibly explain them.
> 
> Certainly this is too many options for a first patch series, but I don't
> think they're unexplainable.  (I listed a bunch of options because I was
> trying to envision where this might take us in the long run.)
Actually I think they are too many for any point in time.
Maybe pull.updateArgs would make more sense.
> For the first patch series, I'd expect:  merge (which uses the merge.ff
> option to determine whether to ff, ff-only, or no-ff), rebase, and ff-only.
Seems sensible.
Show 13 quoted lines
> > then it might make sense to have these two options.
> > 
> > However, that doesn't change the proposal you described above (1. 2.
> > 3.).
> 
> Not sure what you mean.  I oulined three usage cases:
>   #1 update local branch to @{u}
>   #2 update a published branch to its "parent" branch
>   #3 integrate a completed task into the main line of development
> 
> Having these two sets of options (updateMode and integrateMode) would
> make it possible to configure plain 'git pull' to handle usage case #1
> and 'git pull $remote [$refspec]' to handle usage cases #2 and #3.
Not if by default they are already handled.
Show 19 quoted lines
> > There's something we can do, and let me clarify my proposal. What you
> > described above is what I think should happen eventually, however, we
> > can start by doing something like what my patch series is doing; issue a
> > warning that the merge is not fast-forward and things might change in
> > the future.
> 
> OK, let me rephrase to make sure I understand:
> 
>   1. leave the default behavior as-is for now (merge with local
>      branch the first parent)
>   2. add --merge argument
>   3. add ff-only setting
>   4. plan to eventually change the plain 'git pull' default to ff-only,
>      but don't change the default yet
>   5. add a warning if the plain 'git pull' is a non-ff
>   6. wait and see how users react.  If they're OK with it, switch the
>      default of the plain 'git pull' to ff-only.
> 
> Is that accurate?  If so, sounds OK to me.
That is what my patch series is doing already, basically.

The new warning I'm proposing would be for the split behavior of 'git merge' and 'git merge $there'. Which is what is worrysome.

> mode = rebase-here-then-merge-no-ff would do what I described
I think that mode is way too specific to be useful for most people.
-- 
Felipe Contreras
Previous: Richard HansenNext: Richard Hansen
Message 42 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.