* [PATCH] Add a --dry-run option to git-svn rebase [not found] <3c20080519141036.GV396@ziti.local> @ 2008-05-19 14:20 ` Seth Falcon 2008-05-20 0:19 ` toby.allsopp (toby.allsopp - NAVMAN) 2008-05-20 0:19 ` Toby Allsopp 0 siblings, 2 replies; 8+ messages in thread From: Seth Falcon @ 2008-05-19 14:20 UTC (permalink / raw) To: git, normalperson; +Cc: Seth Falcon 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> --- 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..de52c12 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, + 'dryrun|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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a --dry-run option to git-svn rebase 2008-05-19 14:20 ` [PATCH] Add a --dry-run option to git-svn rebase Seth Falcon @ 2008-05-20 0:19 ` toby.allsopp (toby.allsopp - NAVMAN) 2008-05-20 3:24 ` Seth Falcon 2008-05-20 3:29 ` Seth Falcon 2008-05-20 0:19 ` Toby Allsopp 1 sibling, 2 replies; 8+ messages in thread From: toby.allsopp (toby.allsopp - NAVMAN) @ 2008-05-20 0:19 UTC (permalink / raw) To: Seth Falcon; +Cc: git, normalperson [resending to correct Eric's email address] On Tue, May 20 2008, Seth Falcon wrote: [...] > diff --git a/git-svn.perl b/git-svn.perl > index 2c53f39..de52c12 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, > + 'dryrun|n' => \$_dry_run, s/dryrun/dry-run/ perhaps? Also, it looks like you've used spaces instead of tabs. Toby. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a --dry-run option to git-svn rebase 2008-05-20 0:19 ` toby.allsopp (toby.allsopp - NAVMAN) @ 2008-05-20 3:24 ` Seth Falcon 2008-05-20 3:29 ` Seth Falcon 1 sibling, 0 replies; 8+ messages in thread From: Seth Falcon @ 2008-05-20 3:24 UTC (permalink / raw) To: toby.allsopp (toby.allsopp - NAVMAN); +Cc: git, normalperson * On 2008-05-20 at 12:19 +1200 toby.allsopp (toby.allsopp - NAVMAN) wrote: > [resending to correct Eric's email address] Sorry about that, typoed the address. > s/dryrun/dry-run/ perhaps? Also, it looks like you've used spaces > instead of tabs. I'll address both of those and resend, thanks. + seth -- Seth Falcon | http://userprimary.net/user/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] Add a --dry-run option to git-svn rebase 2008-05-20 0:19 ` toby.allsopp (toby.allsopp - NAVMAN) 2008-05-20 3:24 ` Seth Falcon @ 2008-05-20 3:29 ` Seth Falcon [not found] ` <20080530171831.GB76080@ziti.local> 1 sibling, 1 reply; 8+ messages in thread From: Seth Falcon @ 2008-05-20 3:29 UTC (permalink / raw) To: git, normalperson; +Cc: Seth Falcon 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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <20080530171831.GB76080@ziti.local>]
* Re: [PATCH] Add a --dry-run option to git-svn rebase [not found] ` <20080530171831.GB76080@ziti.local> @ 2008-06-01 10:13 ` Eric Wong 2008-06-02 4:56 ` Seth Falcon 0 siblings, 1 reply; 8+ messages in thread From: Eric Wong @ 2008-06-01 10:13 UTC (permalink / raw) To: Seth Falcon; +Cc: git, Junio C Hamano Seth Falcon <seth@userprimary.net> wrote: > Hi Eric, > > I think this may have slipped by without your notice as I gather > things have been busy for you. > > Could you take a look at this patch and let me know if you like > it/hate it/have a suggestion? > > My motivation was wanting to automate some commit rewritting and > wanting a script to be able to determine what the local upstream > branch is... This patch looks reasonable to me. Acked-by: Eric Wong <normalperson@yhbt.net> > * On 2008-05-19 at 20:29 -0700 Seth Falcon wrote: > > @@ -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'); One minor nit is 'url' not being capitalized in the output. Perhaps: Remote Branch: foo SVN URL: http://asdf/foo/trunk Which would make it consistent with 'git svn info' using spaces: RFC822-style headers would be alright, too. Remote-Branch: foo SVN-URL: http://asdf/foo/trunk I do however harbor a deep dislike of camel-case (used by 'git log --pretty=fuller' and .git/config). RemoteBranch: foo SvnUrl: http://asdf/foo/trunk Hmm, I don't think I've even _noticed_ a real bike shed in decades. Perhaps they should be painted purple with yellow polkadots and have the words "BIKE SHED" on a flashing neon sign. -- Eric Wong ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a --dry-run option to git-svn rebase 2008-06-01 10:13 ` Eric Wong @ 2008-06-02 4:56 ` Seth Falcon 2008-06-02 5:37 ` Junio C Hamano 0 siblings, 1 reply; 8+ messages in thread From: Seth Falcon @ 2008-06-02 4:56 UTC (permalink / raw) To: Eric Wong; +Cc: git, Junio C Hamano * On 2008-06-01 at 03:13 -0700 Eric Wong wrote: > This patch looks reasonable to me. > Acked-by: Eric Wong <normalperson@yhbt.net> > One minor nit is 'url' not being capitalized in the output. > Perhaps: Any of the suggested bike shed colors are fine by me :-) I'll assume the patch is fine as-is, or will be edited by Junio before being applied, unless I hear otherwise. -- Seth Falcon | http://userprimary.net/user/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a --dry-run option to git-svn rebase 2008-06-02 4:56 ` Seth Falcon @ 2008-06-02 5:37 ` Junio C Hamano 0 siblings, 0 replies; 8+ messages in thread From: Junio C Hamano @ 2008-06-02 5:37 UTC (permalink / raw) To: Seth Falcon; +Cc: Eric Wong, git Seth Falcon <seth@userprimary.net> writes: > * On 2008-06-01 at 03:13 -0700 Eric Wong wrote: >> This patch looks reasonable to me. >> Acked-by: Eric Wong <normalperson@yhbt.net> > >> One minor nit is 'url' not being capitalized in the output. >> Perhaps: > > Any of the suggested bike shed colors are fine by me :-) I'll assume > the patch is fine as-is, or will be edited by Junio before being > applied, unless I hear otherwise. Yeah, I've queued the patch. Thanks, both. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Add a --dry-run option to git-svn rebase 2008-05-19 14:20 ` [PATCH] Add a --dry-run option to git-svn rebase Seth Falcon 2008-05-20 0:19 ` toby.allsopp (toby.allsopp - NAVMAN) @ 2008-05-20 0:19 ` Toby Allsopp 1 sibling, 0 replies; 8+ messages in thread From: Toby Allsopp @ 2008-05-20 0:19 UTC (permalink / raw) To: Seth Falcon; +Cc: git, normalperson On Tue, May 20 2008, Seth Falcon wrote: [...] > diff --git a/git-svn.perl b/git-svn.perl > index 2c53f39..de52c12 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, > + 'dryrun|n' => \$_dry_run, s/dryrun/dry-run/ perhaps? Also, it looks like you've used spaces instead of tabs. Toby. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-06-02 5:38 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <3c20080519141036.GV396@ziti.local> 2008-05-19 14:20 ` [PATCH] Add a --dry-run option to git-svn rebase Seth Falcon 2008-05-20 0:19 ` toby.allsopp (toby.allsopp - NAVMAN) 2008-05-20 3:24 ` Seth Falcon 2008-05-20 3:29 ` Seth Falcon [not found] ` <20080530171831.GB76080@ziti.local> 2008-06-01 10:13 ` Eric Wong 2008-06-02 4:56 ` Seth Falcon 2008-06-02 5:37 ` Junio C Hamano 2008-05-20 0:19 ` Toby Allsopp
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).