{"thread":{"id":"41022","subject":"No auto CRLF conversion in Commit Message comments","startedAt":"2015-12-16T15:13:41Z","lastAt":"2015-12-17T11:58:10Z","messageCount":3,"participants":["Harfoot A.J.","Johannes Schindelin","Andrew Harfoot"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"274576","messageId":"FBEAE9E9FAB4174499E31C0F26B4BACD2DED2E66@SRV00048.soton.ac.uk","threadId":"41022","inReplyTo":null,"subject":"No auto CRLF conversion in Commit Message comments","fromName":"Harfoot A.J.","fromEmail":"a.j.p.harfoot@soton.ac.uk","sentAt":"2015-12-16T15:13:41Z","receivedAt":"2015-12-16T15:13:41Z","isPatch":false,"sender":{"key":"a.j.p.harfoot@soton.ac.uk","avatar":null},"body":"Hi there,\n\nI'm new to Git, so apologies if this is already available, but after some searching and experimenting I haven't been able to resolve it.\n\nI am running Git 2.6.4.windows.1 on Windows 7 64 bit.\n\nI have the global configuration variable core.autocrlf=true\n\nWhen I commit, the commit message template file is loaded into my configured text editor (in this case Windows Notepad), however the comment lines are terminated with LF, not CRLF, and so are not displayed as new lines by Notepad.\nIn the opposite direction, the output of 'git log' redirected to a file has all EOL characters set to LF, when originally entered as CRLF, so automatic conversion is working\n\nI have tried to generate a custom commit message using the commit.template variable, but the commented lines are appended to this file, creating a mixture of EOL characters!\n\nIs there a way to fix this inconsistency?\n\nCheers,\n\nAndy\n\n-- \n\nAndy Harfoot\n\nGeoData Institute\nUniversity of Southampton\nSouthampton\nSO17 1BJ\n\nTel:  +44 (0)23 8059 2719\nFax:  +44 (0)23 8059 2849\n\nwww.geodata.soton.ac.uk"},{"id":"274592","messageId":"alpine.DEB.2.20.1512161738080.6483@virtualbox","threadId":"41022","inReplyTo":"FBEAE9E9FAB4174499E31C0F26B4BACD2DED2E66@SRV00048.soton.ac.uk","subject":"Re: No auto CRLF conversion in Commit Message comments","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-12-16T16:45:16Z","receivedAt":"2015-12-16T16:45:16Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi A.J.,\n\nOn Wed, 16 Dec 2015, Harfoot A.J. wrote:\n\n> I'm new to Git, so apologies if this is already available, but after\n> some searching and experimenting I haven't been able to resolve it.\n> \n> I am running Git 2.6.4.windows.1 on Windows 7 64 bit.\n> \n> I have the global configuration variable core.autocrlf=true\n> \n> When I commit, the commit message template file is loaded into my\n> configured text editor (in this case Windows Notepad), however the\n> comment lines are terminated with LF, not CRLF, and so are not displayed\n> as new lines by Notepad.\n\nThe core.autocrlf=true setting affects only Git's operation when it adds\nfile contents to the index or writes files from the index.\n\nHowever, if you have `core.editor = notepad`, it should Just Work because\nthere is a `notepad` helper that performs the LF<->CR/LF translation\ntransparently.\n\n> In the opposite direction, the output of 'git log' redirected to a file\n> has all EOL characters set to LF, when originally entered as CRLF, so\n> automatic conversion is working\n\nSomehow I doubt that `git log` transforms CR/LF to LF...\n\n> I have tried to generate a custom commit message using the\n> commit.template variable, but the commented lines are appended to this\n> file, creating a mixture of EOL characters!\n\nI am afraid that the only way to keep that consistent would be to ensure\nthat your commit.template has the same line endings as your editor\nproduces.\n\nCiao,\nJohannes\n"},{"id":"274663","messageId":"5672A352.60001@geodata.soton.ac.uk","threadId":"41022","inReplyTo":"alpine.DEB.2.20.1512161738080.6483@virtualbox","subject":"Re: No auto CRLF conversion in Commit Message comments","fromName":"Andrew Harfoot","fromEmail":"ajph@geodata.soton.ac.uk","sentAt":"2015-12-17T11:58:10Z","receivedAt":"2015-12-17T11:58:10Z","isPatch":false,"sender":{"key":"ajph@geodata.soton.ac.uk","avatar":null},"body":"Hi Johannes,\n\nOn 16/12/2015 16:45, Johannes Schindelin wrote:\n> However, if you have `core.editor = notepad`, it should Just Work because\n> there is a `notepad` helper that performs the LF<->CR/LF translation\n> transparently.\n\nThe problem in my case was that I had\n\n`core.editor = notepad.exe`\n\nThis wasn't triggering the helper, I've changed it, dropping the '.exe' \nand it now works nicely.\n\nThanks for your help,\n\nAndy\n\n-- \nAndy Harfoot\n\nGeoData Institute\nUniversity of Southampton\nSouthampton\nSO17 1BJ\n\nTel:  +44 (0)23 8059 2719\nFax:  +44 (0)23 8059 2849\n\nwww.geodata.soton.ac.uk\n"}]}