@matheusbsbs / matheus-bagliano / commits / 72942938bf
Fork 0

git-svn: allow --find-copies-harder and -l<num> to be passed on commit

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> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Feb 20, 2006 at 10:57 UTC 72942938bfd3587a52906890d7123c49ab71fafc
2 files changed +15 -2
contrib/git-svn/git-svn
+8 -2
@@ -30,7 +30,8 @@ use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
30 use File::Spec qw//;
31 my $sha1 = qr/[a-f\d]{40}/;
32 my $sha1_short = qr/[a-f\d]{6,40}/;
33 -my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit);
33 +my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
34 + $_find_copies_harder, $_l);
35
36 GetOptions( 'revision|r=s' => \$_revision,
37 'no-ignore-externals' => \$_no_ignore_ext,
@@ -38,6 +39,8 @@ GetOptions( 'revision|r=s' => \$_revision,
39 'edit|e' => \$_edit,
40 'rmdir' => \$_rmdir,
41 'help|H|h' => \$_help,
42 + 'find-copies-harder' => \$_find_copies_harder,
43 + 'l=i' => \$_l,
44 'no-stop-on-copy' => \$_no_stop_copy );
45 my %cmd = (
46 fetch => [ \&fetch, "Download new revisions from SVN" ],
@@ -348,7 +351,10 @@ sub svn_checkout_tree {
351 my $pid = open my $diff_fh, '-|';
352 defined $pid or croak $!;
353 if ($pid == 0) {
351 - exec(qw(git-diff-tree -z -r -C), $from, $commit) or croak $!;
354 + my @diff_tree = qw(git-diff-tree -z -r -C);
355 + push @diff_tree, '--find-copies-harder' if $_find_copies_harder;
356 + push @diff_tree, "-l$_l" if defined $_l;
357 + exec(@diff_tree, $from, $commit) or croak $!;
358 }
359 my $mods = parse_diff_tree($diff_fh);
360 unless (@$mods) {
contrib/git-svn/git-svn.txt
+7
@@ -99,6 +99,13 @@ OPTIONS
99 default for objects that are commits, and forced on when committing
100 tree objects.
101
102 +-l<num>::
103 +--find-copies-harder::
104 + Both of these are only used with the 'commit' command.
105 +
106 + They are both passed directly to git-diff-tree see
107 + git-diff-tree(1) for more information.
108 +
109 COMPATIBILITY OPTIONS
110 ---------------------
111 --no-ignore-externals::