1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-10 07:16:09 +02:00

cvsexportcommit: Create config option for CVS dir

For a given project the directory used with the -w option is almost always
the same each time.  Let it be specified with 'cvsexportcommit.cvsdir' so
it's not necessary to manually add it with -w each time.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Acked-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Trent Piepho 2008-05-08 14:26:55 -07:00 committed by Junio C Hamano
parent 824b5dc29c
commit 325abb7b1a
2 changed files with 12 additions and 1 deletions

View File

@ -65,11 +65,17 @@ OPTIONS
-w:: -w::
Specify the location of the CVS checkout to use for the export. This 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 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:: -v::
Verbose. Verbose.
CONFIGURATION
-------------
cvsexportcommit.cvsdir::
The default location of the CVS checkout to use for the export.
EXAMPLES EXAMPLES
-------- --------

View File

@ -6,6 +6,7 @@
use Data::Dumper; use Data::Dumper;
use File::Basename qw(basename dirname); use File::Basename qw(basename dirname);
use File::Spec; 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); 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; 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) { if ($opt_w) {
# Remember where GIT_DIR is before changing to CVS checkout # Remember where GIT_DIR is before changing to CVS checkout
unless ($ENV{GIT_DIR}) { unless ($ENV{GIT_DIR}) {