author | Junio C Hamano <gitster@pobox.com> | |
Sun, 25 May 2008 20:37:20 +0000 (13:37 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 25 May 2008 20:37:20 +0000 (13:37 -0700) |
* js/cvsexportcommit:
cvsexportcommit: introduce -W for shared working trees (between Git and CVS)
cvsexportcommit: chomp only removes trailing whitespace
Conflicts:
git-cvsexportcommit.perl
cvsexportcommit: introduce -W for shared working trees (between Git and CVS)
cvsexportcommit: chomp only removes trailing whitespace
Conflicts:
git-cvsexportcommit.perl
1 | 2 | |||
---|---|---|---|---|
Documentation/git-cvsexportcommit.txt | patch | | diff1 | | diff2 | | blob | history |
git-cvsexportcommit.perl | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/git-cvsexportcommit.txt
index 363c36d694231c5876527ff0d062fbd385d66630,b78c9f36f3568055f259c057dfede77d0d13ee29..f75afaaadc435653822d7851a5bec5a774ff10a3
-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'.
+ -W::
+ Tell cvsexportcommit that the current working directory is not only
+ a Git checkout, but also the CVS checkout. Therefore, Git will
+ reset the working directory to the parent commit before proceeding.
+
-v::
Verbose.
diff --cc git-cvsexportcommit.perl
index c93bd9c9b553f18b29e72a08176588d889e7acde,eaa3218e7904a7f4673785eaf80ce67246f0302f..c6c70e9eba37d14b353e43444c17d815403e66fb
+++ b/git-cvsexportcommit.perl
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);
+ our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w, $opt_W);
- getopts('uhPpvcfam:d:w:');
+ getopts('uhPpvcfam:d:w:W');
$opt_h && usage();
die "Need at least one commit identifier!" unless @ARGV;
- if ($opt_w) {
+# Get git-config settings
+my $repo = Git->repository();
+$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
+
+ if ($opt_w || $opt_W) {
# Remember where GIT_DIR is before changing to CVS checkout
unless ($ENV{GIT_DIR}) {
# No GIT_DIR set. Figure it out for ourselves