On 2014-10-03 11:47-0000 phil rosenberg wrote:

> Okay, well I made some progress on this last night and just pushed the 
> results to the repo.
> I have told CMake to always use Linux line endings for the test shell scripts.

Hi Phil:

It is interesting that your new .gitattributes file with the
pattern

*.sh -text

solves all line-endings issues for you in scripts.  But if
you carefully read
<https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html>
I think you will find you want to use something else.

"*.sh -text" means that all line-ending git processing on checkout and
checkin is dropped for *.sh files.  That's presumably fine (and why it
worked) for the current repo with LF endings on those *.sh files, but
if your editor supplies CRLF endings instead, and you commit that
result, git will happily accept it, and you will not only mess up
Windows users (since you need LF line endings for *.sh files) but also
Unix users.

>From reading the above man page, I believe what you want instead is

*.sh eof=lf

"This setting forces git to normalize line endings to LF on checkin
and prevents conversion to CRLF when the file is checked out."

The above only controls what the line endings are on checkin and
checkout so that protects all other users against any CRLF changes you
might make for those files.  However, git has no control of any local
changes you make in your working directory that are not committed yet.
Your Windows editor could still assert CRLF line endings, and your
tests would not work because of that until you committed the file.
But presumably Windows users of bash scripts like you are aware of
this issue and after editing will manually change the file from CRLF
to LF before running tests.

There is one further potential issue. Have your tests so far only been
for *.sh files in the source tree?

Because I think you would need to set

*.sh.in eof=lf

also in the .gitattributes file to handle those files in the source
tree as well.  Otherwise, I think the CRLF attribute you check out
with those files would propagate to the *.sh version that cmake
configures in the build tree causing you similar line endings
problems when you run those configured scripts.

In sum, I think you should change the .gitattributes file to

*.sh eof=lf
*.sh.in eof=lf

If I am right, (i.e., the result works for you) please commit that
change.

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
__________________________

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to