Skip to content

Commit 325abb7

Browse files
Trent Piephogitster
authored andcommitted
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>
1 parent 824b5dc commit 325abb7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Documentation/git-cvsexportcommit.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ OPTIONS
6565
-w::
6666
Specify the location of the CVS checkout to use for the export. This
6767
option does not require GIT_DIR to be set before execution if the
68-
current directory is within a git repository.
68+
current directory is within a git repository. The default is the
69+
value of 'cvsexportcommit.cvsdir'.
6970

7071
-v::
7172
Verbose.
7273

74+
CONFIGURATION
75+
-------------
76+
cvsexportcommit.cvsdir::
77+
The default location of the CVS checkout to use for the export.
78+
7379
EXAMPLES
7480
--------
7581

git-cvsexportcommit.perl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Data::Dumper;
77
use File::Basename qw(basename dirname);
88
use File::Spec;
9+
use Git;
910

1011
our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w);
1112

@@ -15,6 +16,10 @@
1516

1617
die "Need at least one commit identifier!" unless @ARGV;
1718

19+
# Get git-config settings
20+
my $repo = Git->repository();
21+
$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
22+
1823
if ($opt_w) {
1924
# Remember where GIT_DIR is before changing to CVS checkout
2025
unless ($ENV{GIT_DIR}) {

0 commit comments

Comments
 (0)