{"thread":{"id":"15641","subject":"[PATCH 3/3] git pull: Support --preserve-merges as a flag to rebase","startedAt":"2008-09-23T20:58:20Z","lastAt":"2008-10-15T06:59:59Z","messageCount":2,"participants":["Andreas Ericsson","Stephen Haberman"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"91425","messageId":"48D9586C.4010102@op5.se","threadId":"15641","inReplyTo":null,"subject":"[PATCH 3/3] git pull: Support --preserve-merges as a flag to rebase","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-09-23T20:58:20Z","receivedAt":"2008-09-23T20:58:20Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Now that \"git rebase\" supports non-interactive rebases\npreserving merges, this patch is the next logical step\nfor those who wish to use such a workflow.\n\nSince this patch makes the last test marked as expecting\nfailure in t3409-rebase-preserve-merges, we now alter it\nto expect success.\n\nSigned-off-by: Andreas Ericsson <ae@op5.se>\n---\n Documentation/git-pull.txt        |    4 ++++\n git-pull.sh                       |    6 +++++-\n t/t3409-rebase-preserve-merges.sh |    2 +-\n 3 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex 7578623..333fc55 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -47,6 +47,10 @@ unless you have read linkgit:git-rebase[1] carefully.\n --no-rebase::\n \tOverride earlier --rebase.\n \n+--preserve-merges::\n+\tPreserves merge commits when rebasing. Implies --rebase,\n+\tso the same warnings naturally apply.\n+\n include::fetch-options.txt[]\n \n include::pull-fetch-param.txt[]\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 75c3610..270a50d 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -58,6 +58,10 @@ do\n \t-r|--r|--re|--reb|--reba|--rebas|--rebase)\n \t\trebase=true\n \t\t;;\n+\t--preserve-merges) # no short option for this\n+\t\tpreserve_merges=\"--preserve-merges\"\n+\t\trebase=true\n+\t\t;;\n \t--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)\n \t\trebase=false\n \t\t;;\n@@ -179,7 +183,7 @@ fi\n \n merge_name=$(git fmt-merge-msg $log_arg <\"$GIT_DIR/FETCH_HEAD\") || exit\n test true = \"$rebase\" &&\n-\texec git-rebase $strategy_args --onto $merge_head \\\n+\texec git-rebase $preserve_merges $strategy_args --onto $merge_head \\\n \t${oldremoteref:-$merge_head}\n exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \\\n \t\"$merge_name\" HEAD $merge_head\ndiff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh\nindex 21b8c79..9a376ef 100644\n--- a/t/t3409-rebase-preserve-merges.sh\n+++ b/t/t3409-rebase-preserve-merges.sh\n@@ -51,7 +51,7 @@ test_expect_success 'setup for merge-preserving rebase' \\\n \tgit commit -a -m \"Modify B2\"\n '\n \n-test_expect_failure 'git pull --rebase -p on moved topic' '\n+test_expect_success 'git pull --rebase -p on moved topic' '\n \tcd clone1 &&\n \tgit pull --rebase --preserve-merges &&\n \ttest $(git rev-list --all --pretty=oneline | grep \"Modify A\" | wc -l) = 1\n-- \n1.6.0.2.307.gc4275.dirty\n"},{"id":"93059","messageId":"20081015015959.38fe9973.stephen@exigencecorp.com","threadId":"15641","inReplyTo":"48D9586C.4010102@op5.se","subject":"Re: [PATCH 3/3] git pull: Support --preserve-merges as a flag to rebase","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T06:59:59Z","receivedAt":"2008-10-15T06:59:59Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"\n> Now that \"git rebase\" supports non-interactive rebases\n> preserving merges, this patch is the next logical step\n> for those who wish to use such a workflow.\n> \n> Since this patch makes the last test marked as expecting\n> failure in t3409-rebase-preserve-merges, we now alter it\n> to expect success.\n\nDoes anyone know the current status of this?\n\nThe first 1/3 and 2/3 of this series is in next now (which grant\nnon-interactive merge-preserving rebasing), but this additional\n--preserve-merges flag to git pull didn't seem to make it.\n\n(Correct me if I'm wrong, I cannot pin point exactly where 1/2\nand 2/3 got merged in, I'm just cheating and looking at the files\nas they exist in next's tip.)\n\nMy grandeur plan is to have this 3/3 go in as well and then follow it\nup with my patch to add a branch.name.preservemerges config variable.\n\nThis will make our internal workflow of \"always rebase local\nchanges/always preserve local merges\" just work with \"git pull\".\n\nDoes this seem reasonable?\n\nThanks,\nStephen\n"}]}