diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt index 9a47b4c397..363c36d694 100644 --- a/Documentation/git-cvsexportcommit.txt +++ b/Documentation/git-cvsexportcommit.txt @@ -65,11 +65,17 @@ OPTIONS -w:: Specify the location of the CVS checkout to use for the export. This option does not require GIT_DIR to be set before execution if the - current directory is within a git repository. + current directory is within a git repository. The default is the + value of 'cvsexportcommit.cvsdir'. -v:: Verbose. +CONFIGURATION +------------- +cvsexportcommit.cvsdir:: + The default location of the CVS checkout to use for the export. + EXAMPLES -------- diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index b6036bd4d3..c93bd9c9b5 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -6,6 +6,7 @@ use Data::Dumper; use File::Basename qw(basename dirname); use File::Spec; +use Git; our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w); @@ -15,6 +16,10 @@ die "Need at least one commit identifier!" unless @ARGV; +# Get git-config settings +my $repo = Git->repository(); +$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w; + if ($opt_w) { # Remember where GIT_DIR is before changing to CVS checkout unless ($ENV{GIT_DIR}) {