git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: CVS import [SOLVED]

From
Jeff King <peff@peff.net>
Date
Feb 20, 2009, 15:28 UTC
Message-ID
<20090220152849.GA3826@coredump.intra.peff.net>
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:
Show 10 quoted lines
> > 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
Previous: Ferry Huberts (Pelagic)Next: Ferry Huberts (Pelagic)
Message 12 of 26 in “CVS import”
  1. Ferry Huberts (Pelagic)Feb 16, 2009
  2. Ferry Huberts (Pelagic)Feb 16, 2009
  3. Johannes SchindelinFeb 16, 2009
  4. Johannes SchindelinFeb 16, 2009
  5. Ferry Huberts (Pelagic)Feb 16, 2009
  6. Johannes SchindelinFeb 16, 2009
  7. Ferry Huberts (Pelagic)Feb 16, 2009
  8. Johannes SchindelinFeb 16, 2009
  9. Ferry Huberts (Pelagic)Feb 17, 2009
  10. Johannes SchindelinFeb 17, 2009
  11. Ferry Huberts (Pelagic)Feb 17, 2009
  12. Jeff KingFeb 20, 2009
  13. Ferry Huberts (Pelagic)Feb 20, 2009
  14. autocrlf=input and safecrlf (was Re: CVS import [SOLVED])Jeff King, Feb 20, 2009
  15. Ferry Huberts (Pelagic)Feb 20, 2009
  16. Jeff KingFeb 23, 2009
  17. Ferry Huberts (Pelagic)Feb 23, 2009
  18. Jeff KingFeb 23, 2009
  19. Ferry Huberts (Pelagic)Feb 23, 2009
  20. Jeff KingFeb 23, 2009
  21. Ferry Huberts (Pelagic)Feb 23, 2009
  22. Jeff KingFeb 24, 2009
  23. Ferry Huberts (Pelagic)Feb 24, 2009
  24. Jeff KingFeb 25, 2009
  25. Ferry Huberts (Pelagic)Feb 25, 2009
  26. Jeff KingFeb 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.