aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-02-20 10:57:26 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-20 13:32:41 -0800
commit8de010ad2802e0718b36f394322c6f25542612d6 (patch)
treeaf694231e927427292eece640ba013cb2cf75e59 /contrib
parent72942938bfd3587a52906890d7123c49ab71fafc (diff)
downloadgit-8de010ad2802e0718b36f394322c6f25542612d6.tar.gz
git-8de010ad2802e0718b36f394322c6f25542612d6.tar.xz
git-svn: Allow for more argument types for commit (from..to)
Allow 'from..to' notation from the command line. More liberal sha1 parsing when reading from stdin no longer requires the sha1 to be the first character, so a leading 'commit ' string is OK. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/git-svn/git-svn13
-rw-r--r--contrib/git-svn/git-svn.txt2
2 files changed, 11 insertions, 4 deletions
diff --git a/contrib/git-svn/git-svn b/contrib/git-svn/git-svn
index 477ec1694..5f23d6b22 100755
--- a/contrib/git-svn/git-svn
+++ b/contrib/git-svn/git-svn
@@ -216,14 +216,21 @@ sub commit {
print "Reading from stdin...\n";
@commits = ();
while (<STDIN>) {
- if (/^([a-f\d]{6,40})\b/) {
+ if (/\b([a-f\d]{6,40})\b/) {
unshift @commits, $1;
}
}
}
my @revs;
- foreach (@commits) {
- push @revs, (safe_qx('git-rev-parse',$_));
+ foreach my $c (@commits) {
+ chomp(my @tmp = safe_qx('git-rev-parse',$c));
+ if (scalar @tmp == 1) {
+ push @revs, $tmp[0];
+ } elsif (scalar @tmp > 1) {
+ push @revs, reverse (safe_qx('git-rev-list',@tmp));
+ } else {
+ die "Failed to rev-parse $c\n";
+ }
}
chomp @revs;
diff --git a/contrib/git-svn/git-svn.txt b/contrib/git-svn/git-svn.txt
index 9912f5a6a..07a236fe1 100644
--- a/contrib/git-svn/git-svn.txt
+++ b/contrib/git-svn/git-svn.txt
@@ -149,7 +149,7 @@ Tracking and contributing to an Subversion managed-project:
# Commit only the git commits you want to SVN::
git-svn commit <tree-ish> [<tree-ish_2> ...]
# Commit all the git commits from my-branch that don't exist in SVN::
- git rev-list --pretty=oneline git-svn-HEAD..my-branch | git-svn commit
+ git commit git-svn-HEAD..my-branch
# Something is committed to SVN, pull the latest into your branch::
git-svn fetch && git pull . git-svn-HEAD