7 gitconfigexec - Change git settings for a given command run only
11 gitconfigexec I<KEY>=I<VALUE> [I<KEY>=I<VALUE> [...]] [--] I<COMMAND> I<ARGS>
15 I<KEY> is a valid git config option (see git-config(1)).
16 Set B<GIT_CONFIG_COUNT>, B<GIT_CONFIG_KEY_I<n>>, and B<GIT_CONFIG_VALUE_I<n>>
17 environment variables, so git(1) takes them as session-override settings.
24 my $arg = shift @ARGV;
29 if(my ($cfg_name, $cfg_value) = $arg =~ /^([^=]+)=(.*)$/)
31 my $idx = int $ENV{'GIT_CONFIG_COUNT'};
32 $ENV{"GIT_CONFIG_KEY_$idx"} = $cfg_name;
33 $ENV{"GIT_CONFIG_VALUE_$idx"} = $cfg_value;
34 $ENV{'GIT_CONFIG_COUNT'}++;
43 # remaining arguments are the command and its arguments
44 exec {$ARGV[0]} @ARGV;
45 ($errno, $errstr) = (int $!, $!);
46 warn "$0: ${ARGV[0]}: $errstr\n";