Commit 7d45e146 authored by Seth Falcon's avatar Seth Falcon Committed by Junio C Hamano

Add a --dry-run option to git-svn rebase

When working with multiple branches in an svn repository, it can be
useful to verify the svn repository and local tracking branch that will
be used for the rebase operation.
Signed-off-by: default avatarSeth Falcon <[email protected]>
Acked-by: default avatarEric Wong <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent d72ab8c8
......@@ -365,11 +365,15 @@ Passed directly to git-rebase when using 'dcommit' if a
-n::
--dry-run::
This is only used with the 'dcommit' command.
This can be used with the 'dcommit' and 'rebase' commands.
Print out the series of git arguments that would show
For 'dcommit', print out the series of git arguments that would show
which diffs would be committed to SVN.
For 'rebase', display the local branch associated with the upstream svn
repository associated with the current branch and the URL of svn
repository that will be fetched from.
--
ADVANCED OPTIONS
......
......@@ -177,6 +177,7 @@ BEGIN
'strategy|s=s' => \$_strategy,
'local|l' => \$_local,
'fetch-all|all' => \$_fetch_all,
'dry-run|n' => \$_dry_run,
%fc_opts } ],
'commit-diff' => [ \&cmd_commit_diff,
'Commit a diff between two trees',
......@@ -557,6 +558,11 @@ sub cmd_rebase {
die "Unable to determine upstream SVN information from ",
"working tree history\n";
}
if ($_dry_run) {
print "Remote Branch: " . $gs->refname . "\n";
print "SVN URL: " . $url . "\n";
return;
}
if (command(qw/diff-index HEAD --/)) {
print STDERR "Cannot rebase with uncommited changes:\n";
command_noisy('status');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment