@matheusbsbs / matheus-bagliano / commits / 325abb7b1a
Fork 0

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>

Trent Piepho committed May 8, 2008 at 14:26 UTC 325abb7b1a5bf47b53e3ae1b585f11ebd6a9fea9
2 files changed +12 -1
Documentation/git-cvsexportcommit.txt
+7 -1
@@ -65,11 +65,17 @@ OPTIONS
65 -w::
66 Specify the location of the CVS checkout to use for the export. This
67 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'.
70
71 -v::
72 Verbose.
73
74 +CONFIGURATION
75 +-------------
76 +cvsexportcommit.cvsdir::
77 + The default location of the CVS checkout to use for the export.
78 +
79 EXAMPLES
80 --------
81
git-cvsexportcommit.perl
+5
@@ -6,6 +6,7 @@ use File::Temp qw(tempdir);
6 use Data::Dumper;
7 use File::Basename qw(basename dirname);
8 use File::Spec;
9 +use Git;
10
11 our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w);
12
@@ -15,6 +16,10 @@ $opt_h && usage();
16
17 die "Need at least one commit identifier!" unless @ARGV;
18
19 +# Get git-config settings
20 +my $repo = Git->repository();
21 +$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
22 +
23 if ($opt_w) {
24 # Remember where GIT_DIR is before changing to CVS checkout
25 unless ($ENV{GIT_DIR}) {