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

Re: [PATCH] Adding rebase merge strategy

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 1, 2007, 22:30 UTC
Message-ID
<20071001223050.GE2137@spearce.org>
In-Reply-To
<550f9510710011521s126ca747v956a6f80182444bb@mail.gmail.com>
Tom Clarke <tom@u2i.com> wrote:
Show 17 quoted lines
> On 10/2/07, Carl Worth <cworth@cworth.org> wrote:
> > What I think I've always wanted is something like the following
> > behavior for "git pull":
> >
> >   * Fast forward if possible
> >
> >   * Otherwise, rebase, but only if there are no conflicts at all
> >
> >   * Otherwise, do the merge as normal, (leave conflict markers in
> >     place allowing the user to fix them up and then commit).
> >
> > Would it be straightforward to turn your rebase merge strategy into
> > something like the above? And if so, would that address the primary
> > concerns that Junio raised?
> 
> Maybe we need a 'pull' strategy' - merge, rebase or <insert name for
> strategy you describe above>.

`git pull -s <name>` takes any merge strategy that git-merge will accept for its -s option. There is also the config option of pull.twohead that indicates what the default merge/pull strategy should be for a two head merge. Most people don't set this, letting the code default to 'recursive'.

But I have to agree with (was it Junio who said this?) doing a rebase in a merge strategy doesn't make sense when conflicts come into play. It gets confusing fast for the end-user as the conflict resolution process is different than for a merge. A long time ago I wrote a git-merge-rebase strategy and gave up on it for basically the same reason. I posted it to the mailing list and I think Linus said "Why?!". That was the end of that thread as I wound up agreeing with him.

Multiple merge strategies can be given (and attempted). A rebase strategy could be attempted before recursive, and if the rebase fails but the recursive succeeds then you get (roughly) what is being described above by Carl. But that still requires a rebase merge strategy. :-\

-- 
Shawn.
Previous: Tom ClarkeNext: Carl Worth
Message 10 of 19 in “Adding rebase merge strategy”
  1. Adding rebase merge strategyTom Clarke, Sep 28, 2007
  2. Johannes SchindelinSep 28, 2007
  3. Tom ClarkeSep 28, 2007
  4. Adding rebase merge strategyTom Clarke, Oct 1, 2007
  5. Johannes SchindelinOct 1, 2007
  6. Junio C HamanoOct 1, 2007
  7. Tom ClarkeOct 1, 2007
  8. Carl WorthOct 1, 2007
  9. Tom ClarkeOct 1, 2007
  10. Shawn O. PearceOct 1, 2007
  11. Carl WorthOct 1, 2007
  12. Junio C HamanoOct 1, 2007
  13. Johannes SchindelinOct 2, 2007
  14. Tom ClarkeOct 2, 2007
  15. Junio C HamanoOct 2, 2007
  16. Tom ClarkeOct 3, 2007
  17. Johannes SchindelinOct 3, 2007
  18. J. Bruce FieldsOct 1, 2007
  19. Junio C HamanoOct 1, 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.