[PATCH 3/3] Make git-svn rebase --dirty pass along --dirty to git-rebase.
From: Simon Sasburg <hidden>
Date: 2016-06-15 22:43:46
Subsystem:
the rest · Maintainer:
Linus Torvalds
Signed-off-by: Simon Sasburg <redacted> --- git-svn.perl | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 22bb47b..5898a26 100755
--- a/git-svn.perl
+++ b/git-svn.perl@@ -63,7 +63,7 @@ my ($_stdin, $_help, $_edit, $_message, $_file, $_template, $_shared, $_version, $_fetch_all, $_no_rebase, - $_merge, $_strategy, $_dry_run, $_local, + $_merge, $_strategy, $_dry_run, $_local, $_dirty, $_prefix, $_no_checkout, $_verbose); $Git::SVN::_follow_parent = 1; my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
@@ -169,6 +169,7 @@ my %cmd = ( 'verbose|v' => \$_verbose, 'strategy|s=s' => \$_strategy, 'local|l' => \$_local, + 'dirty|d' => \$_dirty, 'fetch-all|all' => \$_fetch_all, %fc_opts } ], 'commit-diff' => [ \&cmd_commit_diff,
@@ -482,16 +483,20 @@ sub cmd_find_rev { } sub cmd_rebase { - command_noisy(qw/update-index --refresh/); + unless ($_dirty) { + command_noisy(qw/update-index --refresh/); + } my ($url, $rev, $uuid, $gs) = working_head_info('HEAD'); unless ($gs) { die "Unable to determine upstream SVN information from ", "working tree history\n"; } if (command(qw/diff-index HEAD --/)) { - print STDERR "Cannot rebase with uncommited changes:\n"; - command_noisy('status'); - exit 1; + unless ($_dirty) { + print STDERR "Cannot rebase with uncommited changes:\n"; + command_noisy('status'); + exit 1; + } } unless ($_local) { $_fetch_all ? $gs->fetch_all : $gs->fetch;
@@ -697,6 +702,7 @@ sub rebase_cmd { push @cmd, '-v' if $_verbose; push @cmd, qw/--merge/ if $_merge; push @cmd, "--strategy=$_strategy" if $_strategy; + push @cmd, "--dirty" if $_dirty; @cmd; }
--
1.5.3.4.502.g37c97