# [PATCH] rebase -p: Preserve --no-ff merges

2 messages from 2009-03-20 to 2009-03-20. Participants: Anders Kaseorg, Johannes Schindelin.
Thread: https://gitlist.dev/t/18441

## Anders Kaseorg, 2009-03-20 20:38

Subject: [PATCH] rebase -p: Preserve --no-ff merges
Message-ID: <alpine.DEB.2.00.0903201633440.4457@vinegar-pot.mit.edu>
URL: https://gitlist.dev/e/alpine.DEB.2.00.0903201633440.4457%40vinegar-pot.mit.edu

```
Previously, git rebase -p would turn some merges that had been constructed 
with git merge --no-ff into fast-forwards.  Now it reconstructs those 
merges using --no-ff as well.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
 git-rebase--interactive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 3dc659d..39545cc 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -275,7 +275,7 @@ pick_one_preserving_merges () {
 			if ! GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
 				GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
 				GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
-				output git merge $STRATEGY -m "$msg" \
+				output git merge --no-ff $STRATEGY -m "$msg" \
 					$new_parents
 			then
 				printf "%s\n" "$msg" > "$GIT_DIR"/MERGE_MSG
-- 
1.6.2

```

## Johannes Schindelin, 2009-03-20 22:04

Subject: Re: [PATCH] rebase -p: Preserve --no-ff merges
Message-ID: <alpine.DEB.1.00.0903202300360.6865@intel-tinevez-2-302>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0903202300360.6865%40intel-tinevez-2-302
In-Reply-To: <alpine.DEB.2.00.0903201633440.4457@vinegar-pot.mit.edu>

```
Hi,

On Fri, 20 Mar 2009, Anders Kaseorg wrote:

> Previously, git rebase -p would turn some merges that had been constructed 
> with git merge --no-ff into fast-forwards.  Now it reconstructs those 
> merges using --no-ff as well.
> 
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> ---

First, could I ask you to hold off with patches for rebase -p for a little 
while?  I did a _lot_ of work on rebase -p recently, but it has not 
reached a state that I can submit yet without being ashamed.

Another thing to keep in mind is that some merges do _not_ want to be 
preserved.  IOW if you have a history like this:

- A - B
    \   \
      C - D - E

And your upstream cherry-picked B, after a rebase you are most likely to 
want

- A' - C' - E'

as a result (rather than

- A' - --
     \    \
       C' - D' - E'

which would be rather awkward).

Ciao,
Dscho

P.S.: FWIW you can see my work as part of my 'master' in 
http://repo.or.cz/w/git/dscho.git/

```
