From: Junio C Hamano Date: Sun, 25 May 2008 20:37:20 +0000 (-0700) Subject: Merge branch 'js/cvsexportcommit' X-Git-Tag: v1.5.6-rc0~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6c99f18660f62f90b83f0592c81ab6a4092d6d13;p=git.git Merge branch 'js/cvsexportcommit' * js/cvsexportcommit: cvsexportcommit: introduce -W for shared working trees (between Git and CVS) cvsexportcommit: chomp only removes trailing whitespace Conflicts: git-cvsexportcommit.perl --- 6c99f18660f62f90b83f0592c81ab6a4092d6d13 diff --cc Documentation/git-cvsexportcommit.txt index 363c36d69,b78c9f36f..f75afaaad --- a/Documentation/git-cvsexportcommit.txt +++ b/Documentation/git-cvsexportcommit.txt @@@ -65,9 -65,13 +65,14 @@@ OPTION -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 c93bd9c9b,eaa3218e7..c6c70e9eb --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@@ -6,21 -6,16 +6,21 @@@ 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); + 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; +# Get git-config settings +my $repo = Git->repository(); +$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w; + - if ($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