git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Add a --dry-run option to git-svn rebase

From
Seth Falcon <seth@userprimary.net>
Date
May 20, 2008, 03:29 UTC
Message-ID
<1211254157-41316-1-git-send-email-seth@userprimary.net>
In-Reply-To
<87hcctygah.fsf@nav-akl-pcn-343.mitacad.com>

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>
---
Reworked to fix the spelling of dry-run and whitespace issues.
 Documentation/git-svn.txt |    8 ++++++--
 git-svn.perl              |    6 ++++++
 2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index c6b56b4..5890028 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -342,11 +342,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
diff --git a/git-svn.perl b/git-svn.perl
index 2c53f39..9c60ef4 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -176,6 +176,7 @@ my %cmd = (
 			  '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',
@@ -553,6 +554,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');
-- 
1.5.5.1.316.g377d9.dirty
Previous: Seth FalconNext: Eric Wong
Message 5 of 8 in “Add a --dry-run option to git-svn rebase”
  1. Add a --dry-run option to git-svn rebaseSeth Falcon, May 19, 2008
  2. Toby AllsoppMay 20, 2008
  3. toby.allsopp (toby.allsopp - NAVMAN)May 20, 2008
  4. Seth FalconMay 20, 2008
  5. Add a --dry-run option to git-svn rebaseSeth Falcon, May 20, 2008
  6. Eric WongJun 1, 2008
  7. Seth FalconJun 2, 2008
  8. Junio C HamanoJun 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.