Thanks a lot for the post - very interesting! One comment though - it seems that -p does preserve merge history, but it modifies the recreated commit from which the merge was performed. Below is an example (a bit long) flow that illustrates this issue (output of most commands was removed, only the relevant output was included) - the preserved commit contains the merge result, and not the initial commit as on the feature branch:
git logk # logk is an alias for nicely formatted log command.
* f55163e - (HEAD, master) Merge branch 'feature' (43 seconds ago) <Alex Pulver>
|\
| * 2b51d05 - (feature) wrote 2 (43 seconds ago) <Alex Pulver>
|/
* 34edfbc - (origin/master) added file.txt (43 seconds ago) <Alex Pulver>
cd /tmp/rebase_clone1
echo 1 file.txt
git commit -a -m 'wrote 1'
git push origin master
cd /tmp/rebase_clone2
git push origin master
To /tmp/rebase
! [rejected] master -master (fetch first)
error: failed to push some refs to '/tmp/rebase'
...
git rebase -p origin/master
error: could not apply 2b51d05... wrote 2
...
pico file.txt # resolve the conflicts.
git add file.txt
git rebase --continue
Thanks a lot for the post - very interesting! One comment though - it seems that -p does preserve merge history, but it modifies the recreated commit from which the merge was performed. Below is an example (a bit long) flow that illustrates this issue (output of most commands was removed, only the relevant output was included) - the preserved commit contains the merge result, and not the initial commit as on the feature branch: