From: Alex Scarborough <hidden> Date: 2016-06-15 22:48:05
Previously, rebase -p would not preserve a merge commit if the merge
could be resolved as a fast-forward. rebase -p now passes --no-ff to
git merge when recreating a merge commit, which ensures that merge
commits created with git merge --no-ff are preserved.
Signed-off-by: Alex Scarborough <redacted>
---
First patch, so here's hoping neither I nor my mail client messed up
too much.
This patch will not apply cleanly to branches which do not have
mh/rebase-fixup merged in, as that series removed the wrap of the
line I changed.
git-rebase--interactive.sh | 2 +-
t/t3416-rebase-preserve-fast-forwardable-merges.sh | 41 ++++++++++++++++++++
2 files changed, 42 insertions(+), 1 deletions(-)
create mode 100755 t/t3416-rebase-preserve-fast-forwardable-merges.sh
@@ -343,7 +343,7 @@ pick_one_preserving_merges () {# No point in merging the first parent, that's HEADnew_parents=${new_parents# $first_parent}if!do_with_authoroutput\-gitmerge$STRATEGY-m"$msg"$new_parents+gitmerge--no-ff$STRATEGY-m"$msg"$new_parentsthenprintf"%s\n""$msg">"$GIT_DIR"/MERGE_MSGdie_with_patch$sha1"Error redoing merge $sha1"
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:48:06
Hi,
On Fri, 22 Jan 2010, Alex Scarborough wrote:
Previously, rebase -p would not preserve a merge commit if the merge
could be resolved as a fast-forward. rebase -p now passes --no-ff to
git merge when recreating a merge commit, which ensures that merge
commits created with git merge --no-ff are preserved.
For my use case (well, it used to be my use case), namely keeping a number
of topic branches on top of an upstream up-to-date, this is not the
desired action. In my use case, merged topic branches should just vanish,
and not even leave a merge commit.
First patch, so here's hoping neither I nor my mail client messed up
too much.
I think you did real fine, even providing a test case, which not many
submitters do!
Ciao,
Dscho
From: Alex Scarborough <hidden> Date: 2016-06-15 22:48:06
On Mon, Jan 25, 2010, Johannes Schindelin wrote:
On Fri, 22 Jan 2010, Alex Scarborough wrote:
quoted
Previously, rebase -p would not preserve a merge commit if the merge
could be resolved as a fast-forward. rebase -p now passes --no-ff to
git merge when recreating a merge commit, which ensures that merge
commits created with git merge --no-ff are preserved.
For my use case (well, it used to be my use case), namely keeping a number
of topic branches on top of an upstream up-to-date, this is not the
desired action. In my use case, merged topic branches should just vanish,
and not even leave a merge commit.
I see. In that use case this patch would be rather irritating :)
What do you think of adding a --no-ff option to git rebase which, when used
with -p, will recreate merge commits even if they could be resolved as a
fast-forward? That would leave your use case unchanged while giving my
use case a way out, so to speak.
Either way, I suggest we change the documentation for rebase -p to state
that it does not preserve merge commits that can be fast-forwarded after
rebasing.
If it sounds good, I should be able to roll some patches by the end of the
week.
-Alex Scarborough
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:48:06
Hi,
On Mon, 25 Jan 2010, Alex Scarborough wrote:
On Mon, Jan 25, 2010, Johannes Schindelin wrote:
quoted
On Fri, 22 Jan 2010, Alex Scarborough wrote:
quoted
Previously, rebase -p would not preserve a merge commit if the merge
could be resolved as a fast-forward. rebase -p now passes --no-ff
to git merge when recreating a merge commit, which ensures that
merge commits created with git merge --no-ff are preserved.
For my use case (well, it used to be my use case), namely keeping a
number of topic branches on top of an upstream up-to-date, this is not
the desired action. In my use case, merged topic branches should just
vanish, and not even leave a merge commit.
I see. In that use case this patch would be rather irritating :)
What do you think of adding a --no-ff option to git rebase which, when
used with -p, will recreate merge commits even if they could be resolved
as a fast-forward? That would leave your use case unchanged while
giving my use case a way out, so to speak.
That would make most sense, I agree.
Thanks,
Dscho