summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbbc8c3)
raw | patch | inline | side by side (parent: bbbc8c3)
author | Eric Wong <normalperson@yhbt.net> | |
Sun, 2 Apr 2006 02:25:02 +0000 (18:25 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 2 Apr 2006 05:57:52 +0000 (21:57 -0800) |
repo-config keys are any of the long option names minus the '-'
characters
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
characters
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/git-svn/git-svn.perl | patch | blob | history |
index 59dd504047d739036a3ff666476641c2cf57e898..edfb19c39e969c71c270c3e14378b80780ab438f 100755 (executable)
my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
+# convert GetOpt::Long specs for use by git-repo-config
+foreach my $o (keys %opts) {
+ my $v = $opts{$o};
+ my ($key) = ($o =~ /^([a-z\-]+)/);
+ $key =~ s/-//g;
+ my $arg = 'git-repo-config';
+ $arg .= ' --int' if ($o =~ /=i$/);
+ $arg .= ' --bool' if ($o !~ /=[sfi]$/);
+ $arg .= " svn.$key"; # $key only matches [a-z\-], always shell-safe
+ if (ref $v eq 'ARRAY') {
+ chomp(@$v = `$arg`);
+ } else {
+ chomp($$v = `$arg`);
+ $$v = 0 if $$v eq 'false';
+ }
+}
+
GetOptions(%opts, 'help|H|h' => \$_help,
'version|V' => \$_version,
'id|i=s' => \$GIT_SVN) or exit 1;