On 2015-12-20 12:34-0000 Arjen Markus wrote: > Hi everyone,
> Alan and I are developing a new Fortran binding and we would like to cooperate using patches rather than sending complete source files to one another. However, I am experiencing weird problems with the "git am" command. It simply doesn't apply the patches. This may have to do with the line endings (I work on Windows with CRLF and Alan on Linux with CR), but I have been unable to figure out how to get git to do its work. Hi Arjen: I was about to answer your off-list post to me concerning this issue, but taking this conversation to the list at this stage is a good idea so I will answer you here instead. Just to clarify all Unix platforms like mine use LF (not CR) for text file line endings. So when I create the series of patches with git --format-patch, the context lines and change lines are all LF. And there doesn't appear to be any obvious option to git format-patch to change those to CRLF. But Arjen's checked out working directory text files are all (correctly for his platform) CRLF so the patch won't apply without a transformation of those LF endings in the patch context and changed lines to CRLF. By the way, "fresh start" below means starting with a new topic branch that is generated from a clean up-to-date master branch. git am --abort probably produces that, but I wouldn't count on that until we gain more experience. What happens with a fresh start if you try "git am --keep-cr"? I mentioned this possibility off-list before, but as far as I can tell you have not tried it yet. That seems to be the universal advice about what option should be used on Windows platforms with "git am" _even when communicating between Windows platforms_. In the current context of communicating from my Unix platform to your Windows platform I am hoping that what --keep-cr actually does is automatically transform the LF patch context lines and changed lines in my series of patches to CRLF before applying. If that doesn't work, another possibility to try (starting with a fresh start) is to run my patch series through a utility to convert all line endings in the patch file to CRLF before you attempt to use "git am --keep-cr". I cannot see how that method could possibly fail.... (Famous last words. :-) ) But if neither of those ideas work, I will try a question to the git list since surely there must be a method of working with "git format-patch"/"git am" that allows collaboration between developers on Windows and Unix platforms with all line endings issues automatically taken care of. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel