RE: Amending merge commits?
- From
- Besen, David <david.besen@hp.com>
- Date
- Jul 25, 2014, 22:23 UTC
- Message-ID
- <22F01493C523F940B4B5E53BB6D0F5352275F25B@G5W2738.americas.hpqcorp.net>
- In-Reply-To
- <20140725221911.GL12427@google.com>
Ah thanks, I'll RTFM better in the future.
- Dave
-----Original Message----- From: Jonathan Nieder [mailto:jrnieder@gmail.com] Sent: Friday, July 25, 2014 4:19 PM To: Besen, David Cc: git@vger.kernel.org Subject: Re: Amending merge commits?
Besen, David wrote:
> I think one of my coworkers has stumbled on a git bug -- if you > amend a merge commit, and then pull, your amends are lost.
This is how pull --rebase works. It turns your single-parent commits into a sequence of patches on top of upstream and completely ignores your merge commits.
There is a --rebase=preserve option that makes a halfhearted attempt to preserve your merges --- perhaps that would help? The git-rebase(1) documentation has more details.
In an ideal world, I think pull --rebase would do the following:
1. Do the same thing it does today
2. Behind the scenes, *also* try a 'pull --merge' but don't save
the result.
3. Compare the results. If they differ, show a diff and explain
to the user what happened.I may be the only one that wants that, though.
Hope that helps, Jonathan