Re: Indentation style: public/private/protected/case
On Oct 23, 1:21 pm, Kenneth Porter <shiva.blackl...@sewingwitch.com>
James Kanze <james.ka...@gmail.com> wrote in news:1193130405.821858.318190
If the version control system doesn't allow you to insert
scripts before insertion, it's time to replace it with something
else. Immediately. You definitly want to automatically run
your unit tests before check in, and reject the check in if they
fail. If you're able to do this, it's trivial to insert an
additional tool to reformat.
In fact Subversion has a pre-commit hook (on the server side),
but the hook won't modify the committed files. It can only
reject them if they don't meet your criteria.
It did occur to me after posting that regardless of what the
version control offers, it's pretty straightforeward to wrap its
commands in a script---that can do whatever you want. I've
worked in places which used very primitive version control
systems (CVS, SCCS, etc.), and in such cases, the basic commands
were always wrapped in some sort of script---it would be
accurate to say that we actually wrote our own version control
system, using SCCS or CVS as the underlying machine.
Subversion does have eol conversion (if you tag the file with
an eol "property") but I'm not sure if this is done on the
client or server.
Eol represents another bag of worms:-). Think of what happens
on shared file systems. In practice, the simplest solution is
just to configure everything to use the Unix convention, since
this causes no problems with any of the Windows toolset as well.
(The editors I use on Windows have options to allow writing
files back using either convention.) I've no experience with
Mac, but given that modern Mac has Unix under the hood, I would
presume that the Unix convention works there as well. And of
course, for IBM mainframes and the like, you have to transcode
anyway, since they expect EBCDIC.
James Kanze (GABI Software) email:firstname.lastname@example.org
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34