@matheusbsbs / matheus-bagliano / commits / 7d45e14683
Fork 0

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: Seth Falcon <seth@userprimary.net> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Seth Falcon committed May 19, 2008 at 20:29 UTC 7d45e1468331e6253d087e77d9082026320410f5
2 files changed +12 -2
Documentation/git-svn.txt
+6 -2
@@ -365,11 +365,15 @@ Passed directly to git-rebase when using 'dcommit' if a
365 -n::
366 --dry-run::
367
368 -This is only used with the 'dcommit' command.
368 +This can be used with the 'dcommit' and 'rebase' commands.
369
370 -Print out the series of git arguments that would show
370 +For 'dcommit', print out the series of git arguments that would show
371 which diffs would be committed to SVN.
372
373 +For 'rebase', display the local branch associated with the upstream svn
374 +repository associated with the current branch and the URL of svn
375 +repository that will be fetched from.
376 +
377 --
378
379 ADVANCED OPTIONS
git-svn.perl
+6
@@ -177,6 +177,7 @@ my %cmd = (
177 'strategy|s=s' => \$_strategy,
178 'local|l' => \$_local,
179 'fetch-all|all' => \$_fetch_all,
180 + 'dry-run|n' => \$_dry_run,
181 %fc_opts } ],
182 'commit-diff' => [ \&cmd_commit_diff,
183 'Commit a diff between two trees',
@@ -557,6 +558,11 @@ sub cmd_rebase {
558 die "Unable to determine upstream SVN information from ",
559 "working tree history\n";
560 }
561 + if ($_dry_run) {
562 + print "Remote Branch: " . $gs->refname . "\n";
563 + print "SVN URL: " . $url . "\n";
564 + return;
565 + }
566 if (command(qw/diff-index HEAD --/)) {
567 print STDERR "Cannot rebase with uncommited changes:\n";
568 command_noisy('status');