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

Re: Pull is Mostly Evil

From
Max Kirillov <max@max630.net>
Date
May 7, 2014, 22:37 UTC
Message-ID
<20140507223752.GA13933@wheezy.local>
In-Reply-To
<5364A143.1060404@bbn.com>
Hi.

I might be late to this discussion, but here either something I don't understand or something is missed.

On Sat, May 03, 2014 at 03:56:51AM -0400, Richard Hansen wrote:
Show 18 quoted lines
> In my experience 'git pull' is mostly (only?) used for the following
> three tasks:
> 
>  1. update a local branch to incorporate the latest upstream changes
> 
>     In this case, the local branch (master) is a
>     derivative of the upstream branch (origin/master).
>     The user wants all of the commits in the remote branch
>     to be in the local branch.  And the user would like
>     the local changes, if any, to descend from the tip of
>     the remote branch.
> 
>     For this case, 'git pull --ff-only' followed by 'git
>     rebase -p' works well, as does 'git pull
>     --rebase=preserve' if the user is comfortable rebasing
>     without reviewing the incoming commits first.  A plain
>     'git pull' or 'git pull --ff' is suboptimal due to the
>     awkward backwards-parents merge commit.

This is actually not a finally defined use case. What kind of "local changes" user can have ahead of the remote? As far I understand, there are 3 cases:

 1a. Changes that are going to be merged back to the master,
     but not yet ready to be there.

This is essentially the same as case 2, but it does not name the development branch explicitely. Switching parents for this case is not desirable.

 1b. Some truly local changes which never goes anywhere.
For this case the parent order does not matter.
 1c. The local changes prepared for integration, but instead
     of filing a pull request of otherwise publishing the
     branch for integrator, the leaf developer does the
     integrator's job and merges it back to master and then
     publishing the master.

As far as I understand, this is the only case when somebody would want the parents to be switched. And this does not seem to be a good practice, because it's prone to push races and requires letting everyone to push to master. So maybe git should not encourage people to do so.

And the name "update", proposed here, does not seem to be correct. Because what happens is not updating, but merging feature to master and closing it.

>  2. update a published feature branch with the latest
>     changes from its parent branch
>  3. integrate a more-or-less complete feature/fix back
>     into the line of development it forked off of
-- 
Max
Previous: Felipe ContrerasNext: John Szakmeister
Message 45 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.