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

Difference between 'git rebase' and 'git rebase -m'

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Nov 16, 2010, 17:35 UTC
Message-ID
<4CE2C0ED.1030309@workspacewhiz.com>
We ran into an interesting issue yesterday during a rebase.

User Bob had added a line at the same place in a (C++) .h file as User Joe, who had already pushed his one line change. The natural expectation would be a conflict during User Bob's rebase operation, but, in fact, the conflicting patch applied without difficulty.

After an investigation, we discovered this particular file had a near duplicate of its C++ class definition immediately following the original but renamed into a thread-safe version; the rename of the class was the only change to its contents. The default 'git rebase' operation looked some 150 lines into the file, discovered the patch didn't match due to User Joe's added line, continued scanning the file until it found another matching location some 300 lines later (the near duplicate thread-safe version of the class), and applied the patch there.

While coming up with a repro to post here, we cherry picked the individual changes and found the cherry pick properly conflicted.

We further discovered 'git rebase -m' (or 'git rebase -s recursive') also conflicted at the User Bob/Joe modification.

I can post a repro here, if needed.

I'm curious as to why 'git rebase -m' isn't the default and what the real difference is between 'git rebase' and 'git rebase -m'. Additionally, is there any documentation describing how the patch algorithm determines context?

Thanks!
Josh
Next: Jonathan Nieder
Message 1 of 5 in “Difference between 'git rebase' and 'git rebase -m'”
  1. Joshua JensenNov 16, 2010
  2. Jonathan NiederNov 16, 2010
  3. Nguyen Thai Ngoc DuyNov 17, 2010
  4. Michael J GruberNov 17, 2010
  5. Nguyen Thai Ngoc DuyNov 17, 2010

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.