git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Ferry Huberts (Pelagic)" <ferry.huberts@pelagic.nl>,
	git@vger.kernel.org
Subject: Re: CVS import [SOLVED]
Date: Fri, 20 Feb 2009 10:28:49 -0500	[thread overview]
Message-ID: <20090220152849.GA3826@coredump.intra.peff.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0902162157080.6289@intel-tinevez-2-302>

On Mon, Feb 16, 2009 at 09:59:29PM +0100, Johannes Schindelin wrote:

> > I'm working on it now, and did some more testing: it's actually the 
> > safecrlf setting, not the autocrlf option.
> 
> Oh.  That probably means that cvsimport gets confused by the extra 
> warnings.
> 
> However, I think it is not correct to run cvsimport with autocrlf set to 
> anything than false anyway (and safecrlf would not trigger then, right?).
> 
> So IMHO the solution is still to force autocrlf off.

I don't think that's right. What is happening is that git-hash-object is
barfing, and git-cvsimport is not properly detecting the error.
something like this (untested) would make that better:

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e439202..65e7990 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -926,6 +926,7 @@ while (<CVS>) {
 			my $sha = <$F>;
 			chomp $sha;
 			close $F;
+			$? and die "hash-object reported failure";
 			my $mode = pmode($cvs->{'mode'});
 			push(@new,[$mode, $sha, $fn]); # may be resurrected!
 		}

But the problem is not autocrlf. It is that the combination of "autocrlf
= input" and "safecrlf" is nonsensical. Just try this:

  $ git init
  $ git config core.autocrlf input
  $ git config core.safecrlf true
  $ printf 'DOS\r\n' >file
  $ git add file
  fatal: CRLF would be replaced by LF in file.

which makes sense. SafeCRLF is about making sure that the file will be
the same on checkin and checkout. But it won't, because we are only
doing CRLF conversion half the time.

So the best workaround is disabling safecrlf, which makes no sense with
his autocrlf setting. But I also think safecrlf could be smarter by
treating autocrlf=input as autocrlf=true. That is, we don't care if in
our _particular_ config it will come out the same; we care about whether
one could, if so inclined, get the CRLF's back to create a byte-for-byte
identical object.

-Peff

  parent reply	other threads:[~2009-02-20 15:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-16  9:17 CVS import Ferry Huberts (Pelagic)
2009-02-16 13:20 ` CVS import [SOLVED] Ferry Huberts (Pelagic)
2009-02-16 13:45   ` Johannes Schindelin
2009-02-16 13:53     ` Johannes Schindelin
2009-02-16 17:33       ` Ferry Huberts (Pelagic)
2009-02-16 18:11         ` Johannes Schindelin
2009-02-16 20:32   ` Ferry Huberts (Pelagic)
2009-02-16 20:59     ` Johannes Schindelin
2009-02-17 11:19       ` Ferry Huberts (Pelagic)
2009-02-17 14:18         ` Johannes Schindelin
2009-02-17 15:16           ` Ferry Huberts (Pelagic)
2009-02-20 15:28       ` Jeff King [this message]
2009-02-20 16:25         ` Ferry Huberts (Pelagic)
2009-02-20 17:29           ` autocrlf=input and safecrlf (was Re: CVS import [SOLVED]) Jeff King
2009-02-20 23:24             ` Ferry Huberts (Pelagic)
2009-02-23  0:08               ` Jeff King
2009-02-23  6:50                 ` Ferry Huberts (Pelagic)
2009-02-23  6:56                   ` Jeff King
2009-02-23  7:09                     ` Ferry Huberts (Pelagic)
2009-02-23  7:10                       ` Jeff King
2009-02-23  7:29                         ` Ferry Huberts (Pelagic)
2009-02-24  6:11                           ` Jeff King
2009-02-24  9:25                             ` Ferry Huberts (Pelagic)
2009-02-25  6:56                               ` Jeff King
2009-02-25  8:03                                 ` Ferry Huberts (Pelagic)
2009-02-25  9:03                                   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090220152849.GA3826@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ferry.huberts@pelagic.nl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).