git-svn: add -l/--local command to "git svn rebase"
This avoids fetching new revisions remotely, and is usefuly versus plain "git rebase" because the user does not have to specify which remote head to rebase against. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Mar 13, 2007 at 11:40 UTC
dee41f3e5569f9465018535f02d45796d84aebd8
2 files changed
+13
-2
Documentation/git-svn.txt
+8
@@ -104,6 +104,14 @@ accepts. However '--fetch-all' only fetches from the current
104
105
Like 'git-rebase'; this requires that the working tree be clean
106
and have no uncommitted changes.
107
++
108
+--
109
+-l;;
110
+--local;;
111
+ Do not fetch remotely; only run 'git-rebase' against the
112
+ last fetched commit from the upstream SVN.
113
+--
114
++
115
116
'dcommit'::
117
Commit each diff from a specified head directly to the SVN
git-svn.perl
+5
-2
@@ -56,7 +56,7 @@ my ($_stdin, $_help, $_edit,
56
$_message, $_file,
57
$_template, $_shared,
58
$_version, $_fetch_all,
59
- $_merge, $_strategy, $_dry_run,
59
+ $_merge, $_strategy, $_dry_run, $_local,
60
$_prefix, $_no_checkout, $_verbose);
61
$Git::SVN::_follow_parent = 1;
62
my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
@@ -145,6 +145,7 @@ my %cmd = (
145
{ 'merge|m|M' => \$_merge,
146
'verbose|v' => \$_verbose,
147
'strategy|s=s' => \$_strategy,
148
+ 'local|l' => \$_local,
149
'fetch-all|all' => \$_fetch_all,
150
%fc_opts } ],
151
'commit-diff' => [ \&cmd_commit_diff,
@@ -439,7 +440,9 @@ sub cmd_rebase {
440
command_noisy('status');
441
exit 1;
442
}
442
- $_fetch_all ? $gs->fetch_all : $gs->fetch;
443
+ unless ($_local) {
444
+ $_fetch_all ? $gs->fetch_all : $gs->fetch;
445
+ }
446
command_noisy(rebase_cmd(), $gs->refname);
447
}
448