From: Eric Wong <normalperson@yhbt.net>
To: git@vger.kernel.org
Cc: junkio@cox.net, Eric Wong <normalperson@yhbt.net>
Subject: [PATCH 2/9] git-svn: allow --find-copies-harder and -l<num> to be passed on commit
Date: Mon, 20 Feb 2006 10:57:26 -0800 [thread overview]
Message-ID: <11404618464102-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: <11404618452729-git-send-email-normalperson@yhbt.net>
Both of these options are passed directly to git-diff-tree when
committing to a SVN repository.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
contrib/git-svn/git-svn | 10 ++++++++--
contrib/git-svn/git-svn.txt | 7 +++++++
2 files changed, 15 insertions(+), 2 deletions(-)
f00770e6f3151e5fdc94208efab22b3068dbb882
diff --git a/contrib/git-svn/git-svn b/contrib/git-svn/git-svn
index 1a8f40e..477ec16 100755
--- a/contrib/git-svn/git-svn
+++ b/contrib/git-svn/git-svn
@@ -30,7 +30,8 @@ use Getopt::Long qw/:config gnu_getopt n
use File::Spec qw//;
my $sha1 = qr/[a-f\d]{40}/;
my $sha1_short = qr/[a-f\d]{6,40}/;
-my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit);
+my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
+ $_find_copies_harder, $_l);
GetOptions( 'revision|r=s' => \$_revision,
'no-ignore-externals' => \$_no_ignore_ext,
@@ -38,6 +39,8 @@ GetOptions( 'revision|r=s' => \$_revisio
'edit|e' => \$_edit,
'rmdir' => \$_rmdir,
'help|H|h' => \$_help,
+ 'find-copies-harder' => \$_find_copies_harder,
+ 'l=i' => \$_l,
'no-stop-on-copy' => \$_no_stop_copy );
my %cmd = (
fetch => [ \&fetch, "Download new revisions from SVN" ],
@@ -348,7 +351,10 @@ sub svn_checkout_tree {
my $pid = open my $diff_fh, '-|';
defined $pid or croak $!;
if ($pid == 0) {
- exec(qw(git-diff-tree -z -r -C), $from, $commit) or croak $!;
+ my @diff_tree = qw(git-diff-tree -z -r -C);
+ push @diff_tree, '--find-copies-harder' if $_find_copies_harder;
+ push @diff_tree, "-l$_l" if defined $_l;
+ exec(@diff_tree, $from, $commit) or croak $!;
}
my $mods = parse_diff_tree($diff_fh);
unless (@$mods) {
diff --git a/contrib/git-svn/git-svn.txt b/contrib/git-svn/git-svn.txt
index 4b79fb0..9912f5a 100644
--- a/contrib/git-svn/git-svn.txt
+++ b/contrib/git-svn/git-svn.txt
@@ -99,6 +99,13 @@ OPTIONS
default for objects that are commits, and forced on when committing
tree objects.
+-l<num>::
+--find-copies-harder::
+ Both of these are only used with the 'commit' command.
+
+ They are both passed directly to git-diff-tree see
+ git-diff-tree(1) for more information.
+
COMPATIBILITY OPTIONS
---------------------
--no-ignore-externals::
--
1.2.0.gdee6
next prev parent reply other threads:[~2006-02-20 18:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-20 18:57 git-svn: nearing 1.0.0 Eric Wong
2006-02-20 18:57 ` [PATCH 1/9] git-svn: fix a typo in defining the --no-stop-on-copy option Eric Wong
2006-02-20 18:57 ` Eric Wong [this message]
2006-02-20 18:57 ` [PATCH 3/9] git-svn: Allow for more argument types for commit (from..to) Eric Wong
2006-02-20 18:57 ` [PATCH 4/9] git-svn: remove any need for the XML::Simple dependency Eric Wong
2006-02-20 18:57 ` [PATCH 5/9] git-svn: change ; to && in addremove() Eric Wong
2006-02-20 18:57 ` [PATCH 6/9] contrib/git-svn.txt: add a note about renamed/copied directory support Eric Wong
2006-02-20 18:57 ` [PATCH 7/9] git-svn: fix several corner-case and rare bugs with 'commit' Eric Wong
2006-02-20 18:57 ` [PATCH 8/9] contrib/git-svn: add Makefile, test, and associated ignores Eric Wong
2006-02-20 18:57 ` [PATCH 9/9] git-svn: 0.9.1: add --version and copyright/license (GPL v2+) information Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11404618464102-git-send-email-normalperson@yhbt.net \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).