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

Re: [PATCH v2] rebase -X: do not clobber strategy

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Nov 11, 2010, 12:59 UTC
Message-ID
<AANLkTinBhDR2+SGtz4rmj8CrOh4yLPAB3A74BV-yBCxa@mail.gmail.com>
In-Reply-To
<201011111141.33623.trast@student.ethz.ch>
On Thu, Nov 11, 2010 at 5:41 AM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 8 quoted lines
> Martin von Zweigbergk wrote:
>> Btw, why is the default (if no strategy is specifed) for 'git rebase' to
>> use 'recursive', while for 'git merge' "a built-in list of strategies is
>> used instead (git merge-recursive when merging a single head, git
>> merge-octopus otherwise)"?
>
> Because rebase does a tree-level merge, so it never attempts to merge
> than one branch, so octopus never enters the picture.
I can see why octopus doesn't make sense when doing a linearizing
rebase, but what if it's merge-preserving rebase? The call to
'git merge' in git-rebase--interactive.sh looks like this:
    new_parents=${new_parents# $first_parent}
    [...]
    git merge $strategy -m "$msg" $new_parents

Also, it sounds like "a built-in list" is something that could one day be expanded. So my question is then whether it would make sense to call 'git merge' without specifying a strategy when 'git rebase' is called without a strategy?

> Sorry for the original breakage; while it has Mike Lundy assigned as
> author, I resurrected and resubmitted his patch and should have
> noticed.

Well, since there are no other strategies than recursive that support strategy options, it was not really a breakage in reality, at least as far as I can see.

Speaking of that and about my earlier comment about writing a test case, what should really happen if the user calls 'git rebase -s ours -X foo'? Should it really be allowed? (I tried it and it does work, though.)

Previous: Thomas RastNext: Junio C Hamano
Message 5 of 8 in “rebase -X: do not clobber strategy”
  1. rebase -X: do not clobber strategyMartin von Zweigbergk, Nov 10, 2010
  2. Sverre RabbelierNov 10, 2010
  3. Martin von ZweigbergkNov 11, 2010
  4. Thomas RastNov 11, 2010
  5. Martin von ZweigbergkNov 11, 2010
  6. Junio C HamanoNov 11, 2010
  7. Martin von ZweigbergkNov 12, 2010
  8. Junio C HamanoNov 12, 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.