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

Re: [PATCH] pull: Allow pull to preserve merges when rebasing.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 8, 2013, 21:20 UTC
Message-ID
<alpine.DEB.1.00.1308082314320.24252@s15462909.onlinehome-server.info>
In-Reply-To
<1375983492-32282-2-git-send-email-stephen@exigencecorp.com>
Hi Stephen,
On Thu, 8 Aug 2013, Stephen Haberman wrote:
Show 10 quoted lines
> If a user is working on master, and has merged in their feature branch,
> but now has to "git pull" because master moved, with pull.rebase their
> feature branch will be flattened into master.
> 
> This is because "git pull" currently does not know about rebase's
> preserve merges flag, which would this behavior, and instead replay on
> the merge commit of the feature branch onto the new master, and not the
> entire feature branch itself.
> 
> Add a -p/--preserve-merges, to pass along git rebase if --rebase is in affect.
ACK!
> Also add a new pull.preserve-merges config setting, to enable this
> behavior as the default.

This should probably be added to config.txt and Documentation/git-pull.txt, too, right?

FYI I started to rewrite the complete --preserve-merges support for the interactive rebase some time ago, based on the experience of the merging rebases:

	https://github.com/msysgit/git/commit/b733454b

(part of the rebase-i-p branch). The idea is to use the 'exec' command of the interactive rebase to do a much better job, and to allow reordering (and in particular fixup commits) even when trying to preserve merges.

Unfortunately, the resulting branches look slightly differently now, breaking the (horribly complicated -- my fault!) unit tests, and due to an utter lack of time I had to stall that project.

Feel free to play with it if you want!

Ciao, Johannes

Previous: Stephen HabermanNext: Stephen Haberman
Message 4 of 9 in “[RFC] allow git pull to preserve merges”
  1. Stephen HabermanAug 8, 2013
  2. pull: Allow pull to preserve merges when rebasing.Stephen Haberman, Aug 8, 2013
  3. Stephen HabermanAug 8, 2013
  4. Johannes SchindelinAug 8, 2013
  5. Stephen HabermanAug 8, 2013
  6. Philip OakleyAug 8, 2013
  7. Junio C HamanoAug 8, 2013
  8. Johannes SchindelinAug 9, 2013
  9. Stephen HabermanAug 9, 2013

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.