summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc1793e)
raw | patch | inline | side by side (parent: cc1793e)
author | Karl Hasselström <kha@treskal.com> | |
Thu, 3 May 2007 05:51:35 +0000 (07:51 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 4 May 2007 22:08:31 +0000 (15:08 -0700) |
git-svn dcommit exports commits to Subversion, then imports them back
to git again, and last but not least rebases or resets HEAD to the
last of the new commits. I guess this rebasing is convenient when
using just git, but when the commits to be exported are managed by
StGIT, it's really annoying. So add an option to disable this
behavior. And document it, too!
Signed-off-by: Karl Hasselström <kha@treskal.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
to git again, and last but not least rebases or resets HEAD to the
last of the new commits. I guess this rebasing is convenient when
using just git, but when the commits to be exported are managed by
StGIT, it's really annoying. So add an option to disable this
behavior. And document it, too!
Signed-off-by: Karl Hasselström <kha@treskal.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-svn.txt | patch | blob | history | |
git-svn.perl | patch | blob | history |
index 820a2c308e056b2008f8883b9aebfa5bd6dbe4c7..c0d7d9597b8f569a1e996072bef667f517e74bd2 100644 (file)
alternative to HEAD.
This is advantageous over 'set-tree' (below) because it produces
cleaner, more linear history.
++
+--no-rebase;;
+ After committing, do not rebase or reset.
--
'log'::
diff --git a/git-svn.perl b/git-svn.perl
index 6657e100fbbc3bd83e805b2440b1a7b61780c5f4..3c4f490b742c18b6ba96217f0dc1abb4af054e21 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
my ($_stdin, $_help, $_edit,
$_message, $_file,
$_template, $_shared,
- $_version, $_fetch_all,
+ $_version, $_fetch_all, $_no_rebase,
$_merge, $_strategy, $_dry_run, $_local,
$_prefix, $_no_checkout, $_verbose);
$Git::SVN::_follow_parent = 1;
'verbose|v' => \$_verbose,
'dry-run|n' => \$_dry_run,
'fetch-all|all' => \$_fetch_all,
+ 'no-rebase' => \$_no_rebase,
%cmt_opts, %fc_opts } ],
'set-tree' => [ \&cmd_set_tree,
"Set an SVN repository to a git tree-ish",
return;
}
$_fetch_all ? $gs->fetch_all : $gs->fetch;
- # we always want to rebase against the current HEAD, not any
- # head that was passed to us
- my @diff = command('diff-tree', 'HEAD', $gs->refname, '--');
- my @finish;
- if (@diff) {
- @finish = rebase_cmd();
- print STDERR "W: HEAD and ", $gs->refname, " differ, ",
- "using @finish:\n", "@diff";
- } else {
- print "No changes between current HEAD and ",
- $gs->refname, "\nResetting to the latest ",
- $gs->refname, "\n";
- @finish = qw/reset --mixed/;
+ unless ($_no_rebase) {
+ # we always want to rebase against the current HEAD, not any
+ # head that was passed to us
+ my @diff = command('diff-tree', 'HEAD', $gs->refname, '--');
+ my @finish;
+ if (@diff) {
+ @finish = rebase_cmd();
+ print STDERR "W: HEAD and ", $gs->refname, " differ, ",
+ "using @finish:\n", "@diff";
+ } else {
+ print "No changes between current HEAD and ",
+ $gs->refname, "\nResetting to the latest ",
+ $gs->refname, "\n";
+ @finish = qw/reset --mixed/;
+ }
+ command_noisy(@finish, $gs->refname);
}
- command_noisy(@finish, $gs->refname);
}
sub cmd_find_rev {