{"thread":{"id":"23270","subject":"Dealing with mac linefeeds in git repository","startedAt":"2010-03-31T13:07:40Z","lastAt":"2010-04-01T13:19:05Z","messageCount":3,"participants":["jussi.sirpoma@sks.fi","Ilari Liusvaara"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"138286","messageId":"OF7E748769.D4E7BC90-ONC22576F7.00483B3D-C22576F7.00484D0A@sks.fi","threadId":"23270","inReplyTo":null,"subject":"Dealing with mac linefeeds in git repository","fromName":"","fromEmail":"jussi.sirpoma@sks.fi","sentAt":"2010-03-31T13:07:40Z","receivedAt":"2010-03-31T13:07:40Z","isPatch":false,"sender":{"key":"jussi.sirpoma@sks.fi","avatar":null},"body":"I am running cygwin git version 1.6.4.2.\n\nSome of the source code for our projects is encoded in mac linefeeds due \nto proprietary\nsoftware platform. My current solution is to flag those files tu use no \nlinefeed conversion and\nto use separate diff program by having this in .gitattributes:\n\n*.BA -crlf diff=winmerge\n\nI also have these crlf settings enabled:\n\ncore.autocrlf=true\ncore.safecrlf=true\n\nThis solution works, but is not optimal as git cannot follow the changed \nlines, produce\nannotations or diffs. Now I am wondering if I could make git work with a \nlittle different \nconfiguration:\n\n* The *.BA files with mac linefeeds would be stored with normal linux \nlinefeeds\n* The files would be converted on checkout to mac linefeeds the same way \nas core.autcrlf works\n\nIs this doable or even a good approach?\n\n- Jussi Sirpoma\n"},{"id":"138289","messageId":"20100331141608.GA2542@LK-Perkele-V2.elisa-laajakaista.fi","threadId":"23270","inReplyTo":"OF7E748769.D4E7BC90-ONC22576F7.00483B3D-C22576F7.00484D0A@sks.fi","subject":"Re: Dealing with mac linefeeds in git repository","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2010-03-31T14:16:08Z","receivedAt":"2010-03-31T14:16:08Z","isPatch":false,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"On Wed, Mar 31, 2010 at 04:07:40PM +0300, jussi.sirpoma@sks.fi wrote:\n> I am running cygwin git version 1.6.4.2.\n> \n> Some of the source code for our projects is encoded in mac linefeeds due \n> to proprietary\n> software platform. My current solution is to flag those files tu use no \n> linefeed conversion and\n> to use separate diff program by having this in .gitattributes:\n\n> annotations or diffs. Now I am wondering if I could make git work with a \n> little different \n> configuration:\n> \n> * The *.BA files with mac linefeeds would be stored with normal linux \n> linefeeds\n> * The files would be converted on checkout to mac linefeeds the same way \n> as core.autcrlf works\n> \n> Is this doable or even a good approach?\n \nAFAIK, its doable. One can specify filter programs to be executed when\nchecking out / adding files. That program could do CR <-> LF translation.\n\nSee filter attribute in man gitattributes.\n\n-Ilari\n"},{"id":"138340","messageId":"OF04EBFCA7.AEB239AD-ONC22576F8.003BC70A-C22576F8.0049585D@sks.fi","threadId":"23270","inReplyTo":"20100331141608.GA2542@LK-Perkele-V2.elisa-laajakaista.fi","subject":"Re: Dealing with mac linefeeds in git repository","fromName":"","fromEmail":"jussi.sirpoma@sks.fi","sentAt":"2010-04-01T13:19:05Z","receivedAt":"2010-04-01T13:19:05Z","isPatch":false,"sender":{"key":"jussi.sirpoma@sks.fi","avatar":null},"body":"Thank you Ilari,\n\nThe filter approach seems to work nicely.\n\ngit config --global filter.maclinefeed.smudge 'tr \\\\n \\\\r'\ngit config --global filter.maclinefeed.clean 'tr \\\\r \\\\n'\n\nWith suitable filter and -crlf settings in .gitattributes,\n\n- Jussi Sirpoma\n\n\n\nFrom:\nIlari Liusvaara <ilari.liusvaara@elisanet.fi>\nTo:\njussi.sirpoma@sks.fi\nCc:\ngit@vger.kernel.org\nDate:\n31.03.2010 17:14\nSubject:\nRe: Dealing with mac linefeeds in git repository\nSent by:\ngit-owner@vger.kernel.org\n\n\n\nOn Wed, Mar 31, 2010 at 04:07:40PM +0300, jussi.sirpoma@sks.fi wrote:\n> I am running cygwin git version 1.6.4.2.\n> \n> Some of the source code for our projects is encoded in mac linefeeds due \n\n> to proprietary\n> software platform. My current solution is to flag those files tu use no \n> linefeed conversion and\n> to use separate diff program by having this in .gitattributes:\n\n> annotations or diffs. Now I am wondering if I could make git work with a \n\n> little different \n> configuration:\n> \n> * The *.BA files with mac linefeeds would be stored with normal linux \n> linefeeds\n> * The files would be converted on checkout to mac linefeeds the same way \n\n> as core.autcrlf works\n> \n> Is this doable or even a good approach?\n \nAFAIK, its doable. One can specify filter programs to be executed when\nchecking out / adding files. That program could do CR <-> LF translation.\n\nSee filter attribute in man gitattributes.\n\n-Ilari\n"}]}