threads / patch / 18441

patchrebase -p: Preserve --no-ff merges

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

## tl;dr

2 messages between Mar 20, 2009 and Mar 20, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Anders Kaseorg· Mar 20, 2009, 20:38 UTC · lore

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(-)
Show changes to git-rebase--interactive.sh +1 −1
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· Mar 20, 2009, 22:04 UTC · re: Anders Kaseorg · lore

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

Hi,
On Fri, 20 Mar 2009, Anders Kaseorg wrote:
Show 6 quoted lines
> 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/

← back to recent threads