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

Defaulting --rebase-merges overall?

From
Tao Klerks <tao@klerks.biz>
Date
Feb 3, 2023, 18:19 UTC
Message-ID
<CAPMMpoj6E-85a59EaHD2aR_oKA=_u78qRV+wp8mqXkR39KctmA@mail.gmail.com>
Hi folks,

I've had a couple of users recently be bitten by "git rebase"'s default handling of merge commits:

* One user had selected the "git config pull.rebase true" option from
the "Need to specify how to reconcile divergent branches" pull
conflict hint text, without understanding enough about what that
meant: that if they do a "pull" right after having done a (non-ff)
"merge", their commit history would get mangled with a set of
duplicated commits.
* The other was using a GUI (Intellij IDEA), which offered to rebase
when there was a push conflict, but didn't mention or do anything
special about the fact that the single commit to be rebased on a push
conflict was a merge commit (same consequences)
In terms of "quick wins" to help these users avoid the trap they fell
into, I can think of two "quick wins":
1. Change the "Need to specify how to reconcile divergent branches"
pull conflict hint text to offer "git config pull.rebase merges"
instead of "git config pull.rebase true"
2. Offer a global "--rebase-merges by default" config option (I know
there is already a per-branch option, but that's really not very
effective when people are creating new branches all the time)

I've scanned the archives of the last year or two and can't find any chatter or activity around this - does anyone have an opinion regarding either of these approaches?

Ideally I'd like to do both. The hint change for people who follow the hint without understanding the dangers, and the global config option for people who understand this historical weirdness of rebase and would rather see the back of it, now that "--rebase-merges" exists and improves rebase behavior for most users under most circumstances. Presumably with such a global config option we would also need a "--no-rebase-merges" option to counter its effect on-demand?

As I think about it, the global option sounds like it might be hard to prove the correctness of (and compatibility with the hosts of other options), so I probably won't be qualified to do this. Is there any objection to the simple hint change, at least?

Thanks, Tao

Next: Junio C Hamano
Message 1 of 2 in “Defaulting --rebase-merges overall?”
  1. Tao KlerksFeb 3, 2023
  2. Junio C HamanoFeb 3, 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.