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

Re: [PATCH] rebase: Allow merge strategies to be used when rebasing

From
Junio C Hamano <junkio@cox.net>
Date
Jun 21, 2006, 11:01 UTC
Message-ID
<7vac8622nm.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060621100138.GA15748@localdomain>
Eric Wong <normalperson@yhbt.net> writes:
Show 15 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
>>
>> >> 	git-merge-$strategy $cmt^ -- HEAD $cmt
>> >
>> > Changing the 'git-merge $strategy_args "rebase-merge: $cmt" HEAD "$cmt"'
>> > line in call_merge() to this seems to have broken more tests.
>> 
>> Oh, that is to be expected if you changed git-merge -s recursive
>> with git-merge-recursive without other changes.  The former
>> makes a commit (which your original patch later used to create a
>> separate commit chain and discarded); the latter does not make a
>> commit but expects the caller to create a commit out of the
>> resulting index file.
>
> Oops, *smacks head*

Well, but you used it to do the right thing after all ;-). The patch looks quite good.

Show 12 quoted lines
>> I was originally hoping that rebasing would just be a matter of
>> listing sequence of commits to be ported onto a new base and
>> running "git-cherry-pick" on each of them in sequence.  Now
>> cherry-pick does not use merge machinery (hence does not use
>> git-merge-recursive), but if we change that then updating rebase
>> would be pretty much straightforward.  It just needs a UI layer
>> to guide the user through recovery process when the merge does
>> not resolve cleanly in the middle, no?
>
> Sounds workable right to me. But then again, a cherry-pick is also a
> case of rebase on a single commit, so we could be using rebase (and its
> recovery code) in cherry-pick, too, right?

Revert and cherry-pick are quite similar operation (the only difference is that you swap his and pivot when doing revert), so when you implement cherry-pick as an atomic operation you can have revert almost for free. If you have a rebase like you did, it would be a bit more involved to make it do revert as well.

Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 11 in “rebase: Allow merge strategies to be used when rebasing”
  1. rebase: Allow merge strategies to be used when rebasingEric Wong, Jun 18, 2006
  2. Junio C HamanoJun 18, 2006
  3. Eric WongJun 19, 2006
  4. Junio C HamanoJun 19, 2006
  5. Eric WongJun 21, 2006
  6. rebase: Allow merge strategies to be used when rebasingEric Wong, Jun 21, 2006
  7. 1/3 rebase: Allow merge strategies to be used when rebasingEric Wong, Jun 21, 2006
  8. 3/3 rebase: error out for NO_PYTHON if they use recursive mergeEric Wong, Jun 21, 2006
  9. Junio C HamanoJun 21, 2006
  10. Junio C HamanoJun 21, 2006
  11. Add renaming-rebase test.Junio C Hamano, Jun 18, 2006

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.