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

Re: Rebase, please help

From
Junio C Hamano <junkio@cox.net>
Date
Apr 11, 2007, 07:38 UTC
Message-ID
<7v8xczqs1q.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200704110852.00540.litvinov2004@gmail.com>
Alexander Litvinov <litvinov2004@gmail.com> writes:
Show 6 quoted lines
> I have found that rebase have (new) option : --merge
> Looking at the code show me that regular rebase is a simply format-patch and 
> am but --merge (or -s) use some merge stratyegy to merge changes between two 
> commits into current head.
>
> What is --merge for ? Will the result be the same ?

Regular "rebase" uses "format-patch" piped to "am -3", so if you do not have renames the file-level patch conflict can be resolved using the 3-way merge logic. However, because we do not give -M to format-patch, it does not deal with case where you have renames in the series of commits you are rebasing, nor where you have renames between the current base commit and the commit you are rebasing onto (the latter won't be solved with giving -M to format-patch anyway, so we do not even try).

In cases involving such renames, giving --merge option would probably be nicer to work with. It invokes merge-recursive logic to deal with the renames.

I find that the regular rebase without --merge is faster (at least it feels to me that it is, and I kind of understand why; patch application to write out a tree is optimized to take advantage of cache-tree extension, as opposed to merging three trees which clobbers it), when there is no patch conflict. Since most rebases do not involve patch conflict for me and seldom involve rebases, I almost never use --merge myself, but this would depend highly on personal taste and project.

Previous: Alexander LitvinovNext: Andy Parkins
Message 2 of 8 in “Rebase, please help”
  1. Alexander LitvinovApr 11, 2007
  2. Junio C HamanoApr 11, 2007
  3. Andy ParkinsApr 11, 2007
  4. Junio C HamanoApr 12, 2007
  5. Linus TorvaldsApr 12, 2007
  6. Alex RiesenApr 11, 2007
  7. Junio C HamanoApr 11, 2007
  8. Alex RiesenApr 11, 2007

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.