Re: CVS import [SOLVED]
Hi,
On Mon, 16 Feb 2009, Johannes Schindelin wrote:
Show 18 quoted lines
> On Mon, 16 Feb 2009, Ferry Huberts (Pelagic) wrote:
>
> > I solved it:
> >
> > it has to do with the
> > core.autocrlf=input
> > core.safecrlf=true
> >
> > settings I had in my global config.
>
> Thanks!
>
> > Maybe the manual page should warn against having these defined?
>
> Maybe it should be solved differently? As cvsimport needs to operate with
> autocrlf=false, it seems, it could set that variable when it creates a
> repository, and check the variable otherwise (erroring out if it is set
> inappropriately)?
IOW something like this:
-- snip --
git-cvsimport.perl | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e439202..a27cc94 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -562,12 +562,16 @@ my %index; # holds filenames of one index per branch
unless (-d $git_dir) {
system("git-init");
die "Cannot init the GIT db at $git_tree: $?\n" if $?;
+ system("git-config core.autocrlf false");
+ die "Cannot set core.autocrlf false" if $?;
system("git-read-tree");
die "Cannot init an empty tree: $?\n" if $?;
$last_branch = $opt_o;
$orig_branch = "";
} else {
+ die "Cannot operate with core.autocrlf other than 'false'"
+ if (`git-config --bool core.autocrlf` =~ /true|input/);
open(F, "git-symbolic-ref HEAD |") or
die "Cannot run git-symbolic-ref: $!\n";
chomp ($last_branch = <F>);
-- snap --
If you could add a test to t9600 and a few words to the man page, that
would be awesome.
Ciao,
Dscho
P.S.: I think the same strategy should be applied to git-svn...