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

Re: [PATCH] pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Feb 21, 2023, 17:45 UTC
Message-ID
<CAMMLpeR0Z1Ay_ubHuGVz4f5RfxhhmoKsNq=OsaL5TB3WHXfJvA@mail.gmail.com>
In-Reply-To
<CAPMMpohfF5Cwgxt_G+Gp4rNPGTJZcQfmgEoJcFi_Kzbv2XGuog@mail.gmail.com>
On Tue, Feb 21, 2023 at 8:40 AM Tao Klerks <tao@klerks.biz> wrote:
Show 13 quoted lines
>
> 2. The fact that the commit history of non-expert git users (those who
> should not be using rebase, especially in teams) are so often...
> spidery... is why the "Squash" option of pull requests / merge
> requests is so popular in centralized workflows (GitHub, GitLab,
> BitBucket, etc).
>
> If your project follows a "merge down, squash up" strategy with a
> well-CI-guarded evergreen trunk on a central server, there's simply no
> reason to *require* your users to become rebasing experts - you can
> let them use simple merge-based workflows, keep your trunk clean by
> squashing away their complex commit graphs, let them merge down
> whenever they need or want to, etc.

The advantage to that workflow is that you don't have to teach users how to rebase. (Whether the actual process of merging or rebasing is easier, assuming that the user knows how to do both, is debatable and likely depends a lot on the particular situation.) The disadvantage is that even merge requests that seem like they only need one commit often turn into multiple commits, and squashing all of those commits together indiscriminately both makes it harder for the reviewer to follow the progression of steps the developer took and decreases the usefulness of tools like `git blame` and `git bisect`. For example, the patch series that I sent to add a rebase.merges option will be 3 or 4 commits in the end, and other developers have good reasons to ask me to keep those commits separate instead of squashing them all into a single patch. On top of that, if your developers get the impression that all projects on GitHub/GitLab/whatever use the same workflow, they are likely to cause headaches when they present spidery merge requests to other projects. If you are OK with those tradeoffs then that's fine, Git will support you. My point is simply that every workflow has its advantages and disadvantages, and there's no workflow that solves every problem.

> Do we have any analysis/understanding of how common workflows like
> that of the git or linux projects are, vs github-style fork-based
> projects, vs straight-up single central server projects?

I don't have any statistics (although I would love to see them if they exist), but I do know that all of these workflows are common enough that `git pull` can't assume what the user wants. The warning exists to try to prevent the user from shooting themself in the foot.

> I'm not sure what you mean by "unusual", but I don't think "avoid
> rebase unless you really know what you're doing, merge down at will,
> we will squash your contribution in the pull/merge request at the end
> anyway" is an unusual flow at all nowadays.

The unusual cases are the ones where you mix merge and rebase on your own topic branch. Your developers did that accidentally (despite `git pull` trying to warn them) and suffered because of it, because it isn't well supported right now. I think we all agree that it should be better supported, we just disagree on how to get there.

-Alex
Previous: Tao KlerksNext: Tao Klerks
Message 29 of 34 in “pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"”
  1. pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"Tao Klerks via GitGitGadget, Feb 5, 2023
  2. Alex HenrieFeb 16, 2023
  3. Tao KlerksFeb 16, 2023
  4. Alex HenrieFeb 17, 2023
  5. Tao KlerksFeb 17, 2023
  6. Alex HenrieFeb 17, 2023
  7. Junio C HamanoFeb 17, 2023
  8. Elijah NewrenFeb 18, 2023
  9. Phillip WoodFeb 18, 2023
  10. Tao KlerksFeb 20, 2023
  11. Phillip WoodFeb 20, 2023
  12. Elijah NewrenFeb 20, 2023
  13. Tao KlerksFeb 21, 2023
  14. Sergey OrganovFeb 22, 2023
  15. Elijah NewrenFeb 24, 2023
  16. Sergey OrganovFeb 24, 2023
  17. Elijah NewrenFeb 24, 2023
  18. Sergey OrganovFeb 25, 2023
  19. Elijah NewrenFeb 25, 2023
  20. Sergey OrganovFeb 26, 2023
  21. Elijah NewrenFeb 27, 2023
  22. Sergey OrganovFeb 27, 2023
  23. Elijah NewrenFeb 28, 2023
  24. Elijah NewrenFeb 20, 2023
  25. Tao KlerksFeb 20, 2023
  26. Elijah NewrenFeb 20, 2023
  27. Alex HenrieFeb 20, 2023
  28. Tao KlerksFeb 21, 2023
  29. Alex HenrieFeb 21, 2023
  30. Tao KlerksFeb 21, 2023
  31. Elijah NewrenFeb 24, 2023
  32. Felipe ContrerasFeb 28, 2023
  33. Alex HenrieFeb 28, 2023
  34. Felipe ContrerasMar 1, 2023

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.