{"thread":{"id":"30532","subject":"PATCH: git-svn: support rebase --preserve-merges","startedAt":"2012-05-15T09:09:06Z","lastAt":"2012-05-16T00:36:23Z","messageCount":2,"participants":["Avishay Lavie","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"191541","messageId":"CAHkK2boHtwbpbfQiqWFWn3BaGfJkojVPLisaghY256m+irE3ow@mail.gmail.com","threadId":"30532","inReplyTo":null,"subject":"PATCH: git-svn: support rebase --preserve-merges","fromName":"Avishay Lavie","fromEmail":"avishay.lavie@gmail.com","sentAt":"2012-05-15T09:09:06Z","receivedAt":"2012-05-15T09:09:06Z","isPatch":false,"sender":{"key":"avishay.lavie@gmail.com","avatar":"https://avatars.githubusercontent.com/u/557935?v=4"},"body":"From: Avishay Lavie <avishay.lavie@gmail.com>\nDate: Tue, 15 May 2012 11:45:50 +0300\nSubject: [PATCH] git-svn: support rebase --preserve-merges\n\nWhen git svn rebase is performed after an unpushed merge, the\nrebase operation follows both parents and replays both the user's\nlocal commits and those from the merged branch. This is usually\nnot the intended behavior.\nThis patch adds support for the --preserve-merges/-p flag which\nallows for a better workflow by re-applying merge commits as merges.\n\nSigned-off-by: Avishay Lavie <avishay.lavie@gmail.com>\n---\n Documentation/git-svn.txt |    2 ++\n git-svn.perl              |    4 +++-\n 2 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 34ee785..0d52997 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -572,6 +572,8 @@ config key: svn.repackflags\n --merge::\n -s<strategy>::\n --strategy=<strategy>::\n+-p::\n+--preserve-merges::\n \tThese are only used with the 'dcommit' and 'rebase' commands.\n +\n Passed directly to 'git rebase' when using 'dcommit' if a\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ca038ec..e86d60b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -84,7 +84,7 @@ my ($_stdin, $_help, $_edit,\n \t$_message, $_file, $_branch_dest,\n \t$_template, $_shared,\n \t$_version, $_fetch_all, $_no_rebase, $_fetch_parent,\n-\t$_merge, $_strategy, $_dry_run, $_local,\n+\t$_merge, $_strategy, $_preserve_merges, $_dry_run, $_local,\n \t$_prefix, $_no_checkout, $_url, $_verbose,\n \t$_git_format, $_commit_url, $_tag, $_merge_info, $_interactive);\n $Git::SVN::_follow_parent = 1;\n@@ -233,6 +233,7 @@ my %cmd = (\n \t\t\t  'local|l' => \\$_local,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n \t\t\t  'dry-run|n' => \\$_dry_run,\n+\t\t\t  'preserve-merges|p' => \\$_preserve_merges\n \t\t\t  %fc_opts } ],\n \t'commit-diff' => [ \\&cmd_commit_diff,\n \t                   'Commit a diff between two trees',\n@@ -1570,6 +1571,7 @@ sub rebase_cmd {\n \tpush @cmd, '-v' if $_verbose;\n \tpush @cmd, qw/--merge/ if $_merge;\n \tpush @cmd, \"--strategy=$_strategy\" if $_strategy;\n+\tpush @cmd, \"--preserve-merges\" if $_preserve_merges;\n \t@cmd;\n }\n\n-- \n1.7.9.msysgit.0\n"},{"id":"191570","messageId":"20120516003623.GA7283@dcvr.yhbt.net","threadId":"30532","inReplyTo":"CAHkK2boHtwbpbfQiqWFWn3BaGfJkojVPLisaghY256m+irE3ow@mail.gmail.com","subject":"Re: PATCH: git-svn: support rebase --preserve-merges","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2012-05-16T00:36:23Z","receivedAt":"2012-05-16T00:36:23Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Avishay Lavie <avishay.lavie@gmail.com> wrote:\n> +++ b/git-svn.perl\n> @@ -233,6 +233,7 @@ my %cmd = (\n>  \t\t\t  'local|l' => \\$_local,\n>  \t\t\t  'fetch-all|all' => \\$_fetch_all,\n>  \t\t\t  'dry-run|n' => \\$_dry_run,\n> +\t\t\t  'preserve-merges|p' => \\$_preserve_merges\n>  \t\t\t  %fc_opts } ],\n>  \t'commit-diff' => [ \\&cmd_commit_diff,\n>  \t                   'Commit a diff between two trees',\n\nYou're missing a comma in the above hunk, but otherwise your patch\nlooks trivially correct (no need to resend, I'll fix up on my end).\n"}]}