aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorAvishay Lavie <avishay.lavie@gmail.com>2012-05-15 11:45:50 +0300
committerEric Wong <normalperson@yhbt.net>2012-05-16 19:21:43 -0700
commitb64e1f58158d1d1a8eafabbbf002a1a3c1d72929 (patch)
tree3a1b5df536bec31ef7393c5ace1afce5a21efb1f /git-svn.perl
parent6a4a4822298866ec3386a46d9d8f933b80e3a359 (diff)
downloadgit-b64e1f58158d1d1a8eafabbbf002a1a3c1d72929.tar.gz
git-b64e1f58158d1d1a8eafabbbf002a1a3c1d72929.tar.xz
git-svn: support rebase --preserve-merges
When git svn rebase is performed after an unpushed merge, the rebase operation follows both parents and replays both the user's local commits and those from the merged branch. This is usually not the intended behavior. This patch adds support for the --preserve-merges/-p flag which allows for a better workflow by re-applying merge commits as merges. [ew: fixed a minor syntax error] Signed-off-by: Avishay Lavie <avishay.lavie@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 31d02b5f7..c84842ff0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -106,7 +106,7 @@ my ($_stdin, $_help, $_edit,
$_message, $_file, $_branch_dest,
$_template, $_shared,
$_version, $_fetch_all, $_no_rebase, $_fetch_parent,
- $_merge, $_strategy, $_dry_run, $_local,
+ $_merge, $_strategy, $_preserve_merges, $_dry_run, $_local,
$_prefix, $_no_checkout, $_url, $_verbose,
$_git_format, $_commit_url, $_tag, $_merge_info, $_interactive);
$Git::SVN::_follow_parent = 1;
@@ -255,6 +255,7 @@ my %cmd = (
'local|l' => \$_local,
'fetch-all|all' => \$_fetch_all,
'dry-run|n' => \$_dry_run,
+ 'preserve-merges|p' => \$_preserve_merges,
%fc_opts } ],
'commit-diff' => [ \&cmd_commit_diff,
'Commit a diff between two trees',
@@ -1592,6 +1593,7 @@ sub rebase_cmd {
push @cmd, '-v' if $_verbose;
push @cmd, qw/--merge/ if $_merge;
push @cmd, "--strategy=$_strategy" if $_strategy;
+ push @cmd, "--preserve-merges" if $_preserve_merges;
@cmd;
}