summaryrefslogtreecommitdiff
path: root/git-cvsexportcommit.perl
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@freescale.com>2008-05-08 21:26:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-21 20:07:41 (GMT)
commit325abb7b1a5bf47b53e3ae1b585f11ebd6a9fea9 (patch)
tree938f5e36f04643307bf0a1eb4e60abe0ba67d203 /git-cvsexportcommit.perl
parent824b5dc29cfe4f58d052d2d9273b39d34bf018e0 (diff)
downloadgit-325abb7b1a5bf47b53e3ae1b585f11ebd6a9fea9.zip
git-325abb7b1a5bf47b53e3ae1b585f11ebd6a9fea9.tar.gz
git-325abb7b1a5bf47b53e3ae1b585f11ebd6a9fea9.tar.bz2
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>
Diffstat (limited to 'git-cvsexportcommit.perl')
-rwxr-xr-xgit-cvsexportcommit.perl5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index b6036bd..c93bd9c 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -6,6 +6,7 @@ use File::Temp qw(tempdir);
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 @@ $opt_h && usage();
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}) {