{"thread":{"id":"10537","subject":"git-svn and auto crlf convertion.","startedAt":"2007-10-31T04:49:43Z","lastAt":"2007-10-31T06:30:12Z","messageCount":2,"participants":["Alexander Litvinov","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"57655","messageId":"200710311049.43861.litvinov2004@gmail.com","threadId":"10537","inReplyTo":null,"subject":"git-svn and auto crlf convertion.","fromName":"Alexander Litvinov","fromEmail":"litvinov2004@gmail.com","sentAt":"2007-10-31T04:49:43Z","receivedAt":"2007-10-31T04:49:43Z","isPatch":false,"sender":{"key":"litvinov2004@gmail.com","avatar":null},"body":"Hello.\n\nI have private svn repo with cpp source file in windows encoding (\\r\\n line \nending). I am tring to import it into git using git-svn. To make correct crlf \nconvertion I have made git svn init first then create \ncorrect .git/info/attributes file and import repo using git svn fetch \ncommand. But after import done I have strange situation: after git \ncheckout -f master git status show that almost all text files are modified.\n\nAs I understand situation git-svn put \\r\\n encoded files into repo without \nconvertng them to \\n notation. git-checkout,git-status does the job right and \nfound 'modification' as far as they do the needed convertion.\n\nIs there any way to configure git-svn to make proper convertion or it is \nbroken and need to be fixed ?\n"},{"id":"57659","messageId":"20071031063012.GA7798@muzzle","threadId":"10537","inReplyTo":"200710311049.43861.litvinov2004@gmail.com","subject":"Re: git-svn and auto crlf convertion.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-10-31T06:30:12Z","receivedAt":"2007-10-31T06:30:12Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Alexander Litvinov <litvinov2004@gmail.com> wrote:\n> Hello.\n> \n> I have private svn repo with cpp source file in windows encoding (\\r\\n line \n> ending). I am tring to import it into git using git-svn. To make correct crlf \n> convertion I have made git svn init first then create \n> correct .git/info/attributes file and import repo using git svn fetch \n> command. But after import done I have strange situation: after git \n> checkout -f master git status show that almost all text files are modified.\n> \n> As I understand situation git-svn put \\r\\n encoded files into repo without \n> convertng them to \\n notation. git-checkout,git-status does the job right and \n> found 'modification' as far as they do the needed convertion.\n\nDisclaimer: I'm not yet familiar with git attributes, having never used them.\n\n> Is there any way to configure git-svn to make proper convertion or it is \n> broken and need to be fixed ?\n\nAs far as I can tell, SVN itself will store files with either LF or CRLF\nin the repository when the file is created/updated and applies the line\nconversion properties only to the working tree upon checkout.  This\nmeans that the SVN repository can have a file that's LF but only\nconverted to CRLF when checked out and vice-versa.\n\ngit-svn takes and imports whatever raw data SVN gives it, ignoring any\nproperties set in SVN.  This is very important because SVN transfers\ndeltas for updating files, and if we change the base file; we can't\napply the delta SVN gives us.\n\nIf we converted the newlines in the raw data that SVN gave us, we would\nneed to store what format the original data we got from SVN was in\nbecause of the delta.\n\nWhat I assume svn does is it either:\n\na) reconverts before doing `svn update' or `svn switch'\nb) it ignores newline-only changes when running `svn status' or `svn diff'\n\ngit (as far as I know, and hope) does neither.\n\n-- \nEric Wong\n"}]}