From: Dmitry Potapov Date: Thu, 31 Jul 2008 10:45:29 GMT Subject: Re: [PATCH] git-svn now work with crlf convertion enabled. Message-ID: <20080731104529.GE7008@dpotapov.dyndns.org> In-Reply-To: <200807311257.49108.litvinov2004@gmail.com> On Thu, Jul 31, 2008 at 12:57:48PM +0700, Alexander Litvinov wrote: > > git-svn fetch files with this patch but I have found that git-svn use > git-hash-object and provide file name to store into stdin. As far as file is > a temp file git-hash-object can't correctly apply crlf convertion for the > file. It does not look to be true. I did the following test: mkdir hash_test cd hash_test git init cat <<\=== > hash_test.pl #!/usr/bin/env perl use File::Temp qw/tempfile/; my ($tmp_fh, $tmp_filename) = File::Temp::tempfile(UNLINK => 1); print $tmp_fh "Hi\r\n"; $tmp_fh->flush; system ("echo $tmp_filename | git hash-object --stdin-paths"); === git config core.autocrlf true perl hash_test.pl git config core.autocrlf false perl hash_test.pl and the output was b14df6442ea5a1b382985a6549b85d435376c351 ea6b6afbc2cbed0eb8c0f7561286ab72f349416c which means that the autocrlf conversion is done for temporary files created by perl. (I tested it on Linux and Windows/Cygwin). In any case, I believe the right solution should be adding a new option to git-hash-object to disable any conversion. Dmitry