Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve merges when rebasing #56

Closed
stigkj opened this issue Oct 3, 2013 · 4 comments
Closed

Preserve merges when rebasing #56

stigkj opened this issue Oct 3, 2013 · 4 comments

Comments

@stigkj
Copy link

stigkj commented Oct 3, 2013

Would be nice if git-up preserved merges when rebasing. It seems that can be done by setting a git config variable, though. The only problem left then is setting ORIG_HEAD to the correct value.

@aanand
Copy link
Owner

aanand commented Oct 3, 2013

Never heard of ORIG_HEAD before - now that I've done a bit of Googling, I'm not sure I follow. ORIG_HEAD is set by pull and merge before they do their thing, according to this Stack Overflow answer.

Are you saying git-up should behave similarly and set ORIG_HEAD before it does anything, and if so, what does that have to do with preserving merges?

@stigkj
Copy link
Author

stigkj commented Oct 26, 2013

Sorry for not explaining properly. But first: one uses ORIG_HEAD after git pull/merge to see which changes have been fetched from the server in the git pull/merge, for example like this:

git log ORIG_HEAD..

As it is, git-up already behaves properly with regards to ORIG_HEAD.

Now to the issue at hand. When doing a regular rebase, any unpushed merge commits will be "flattened out". The rebase command has a --preserve-merges option which preserve merge commits when rebasing. The problem with this option is that it sets ORIG_HEAD incorrectly (look at the "Downsides to git rebase -p" section).

So if you could add an option to git-up that preserves merges it would be great! An greater still if you could point ORIG_HEAD to the correct commit afterwards.

@aanand
Copy link
Owner

aanand commented Oct 30, 2013

OK. So merges can currently be preserved by setting git-up.rebase.arguments to --preserve-merges. Perhaps we should always set ORIG_HEAD to whatever HEAD was at the time git-up was run. Does that sound sensible, and would you be happy to implement it?

@aanand
Copy link
Owner

aanand commented Jan 15, 2014

Closing due to quiet - if someone wants to implement and PR this, be my guest.

@aanand aanand closed this as completed Jan 15, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants