summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d2a9a87)
raw | patch | inline | side by side (parent: d2a9a87)
author | Eric Wong <normalperson@yhbt.net> | |
Tue, 12 Dec 2006 22:47:01 +0000 (14:47 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 13 Dec 2006 01:07:05 +0000 (17:07 -0800) |
Previously dcommit would unconditionally commit all patches
up-to and including the current HEAD. Now if an optional
command-line argument is specified, it will only commit
up to the specified revision.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
up-to and including the current HEAD. Now if an optional
command-line argument is specified, it will only commit
up to the specified revision.
Signed-off-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 a45067e16483c2eab509b0f01ed08a82522e384b..c589a9863064ef3e5f12876d40174fb991cf3b59 100644 (file)
manually joining branches on commit.
'dcommit'::
- Commit all diffs from the current HEAD directly to the SVN
+ Commit all diffs from a specified head directly to the SVN
repository, and then rebase or reset (depending on whether or
- not there is a diff between SVN and HEAD). It is recommended
+ not there is a diff between SVN and head). It is recommended
that you run git-svn fetch and rebase (not pull) your commits
against the latest changes in the SVN repository.
+ An optional command-line argument may be specified as an
+ alternative to HEAD.
This is advantageous over 'commit' (below) because it produces
cleaner, more linear history.
diff --git a/git-svn.perl b/git-svn.perl
index 06e89ffecfd998c680da9e91282cbb2dfa4fb9c5..819584baf568aaa77a02df5c529719d692d43caa 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
}
sub dcommit {
+ my $head = shift || 'HEAD';
my $gs = "refs/remotes/$GIT_SVN";
- chomp(my @refs = safe_qx(qw/git-rev-list --no-merges/, "$gs..HEAD"));
+ chomp(my @refs = safe_qx(qw/git-rev-list --no-merges/, "$gs..$head"));
my $last_rev;
foreach my $d (reverse @refs) {
if (quiet_run('git-rev-parse','--verify',"$d~1") != 0) {
}
return if $_dry_run;
fetch();
- my @diff = safe_qx(qw/git-diff-tree HEAD/, $gs);
+ my @diff = safe_qx('git-diff-tree', $head, $gs);
my @finish;
if (@diff) {
@finish = qw/rebase/;
push @finish, qw/--merge/ if $_merge;
push @finish, "--strategy=$_strategy" if $_strategy;
- print STDERR "W: HEAD and $gs differ, using @finish:\n", @diff;
+ print STDERR "W: $head and $gs differ, using @finish:\n", @diff;
} else {
- print "No changes between current HEAD and $gs\n",
- "Hard resetting to the latest $gs\n";
+ print "No changes between current $head and $gs\n",
+ "Resetting to the latest $gs\n";
@finish = qw/reset --mixed/;
}
sys('git', @finish, $gs);