This works for me with indent on C source. It is a little disturbing to
commit a file and then have emacs tell you the file has changed, because
it was reindented.
CVSROOT/commitinfo:
# Automatic indentation of C source files, only .c and .h
#
^module1/* /home/cvs/CVSROOT/indenter
CVSROOT/indenter (and chmod +x):
#!/bin/bash
# Control how indent is run
flags='-nbad
-bap
-nbc
-bbo
-bl
-bli0
-bls
-ncdb
-nce
-cli4
-cp1
-cs
-di2
-ndj
-nfc1
-nfca
-hnl
-i4
-ip4
-lp
-pcs
-nprs
-psl
-saf
-sai
-saw
-nsc
-nsob
-ts4
-nut'
VERSION_CONTROL=none
export VERSION_CONTROL
for f in $*; do
case "$f" in
*.c|*.h)
echo "Indenting $f..."
indent -npro $flags "$f" || exit 1
;;
esac
done
CVSROOT/checkoutlist:
indenter
~Matt
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> On Behalf Of NewsBirdie
> Sent: Tuesday, November 09, 2004 7:05 AM
> To: [EMAIL PROTECTED]
> Subject: How to format source code on commit
>
> Our merges aren't working because of source code formatting issues and
> I'd like to set up CVS to format the source before all commits. We
> currently use an open source java tool (available via command line)
> called Jalopy. Can anyone point me to some documentation and/or
> examples of how to perform a command with each commit?
>
> Thanks,
> Michael
> _______________________________________________
> Info-cvs mailing list
> [EMAIL PROTECTED]
> http://lists.gnu.org/mailman/listinfo/info-cvs
>
_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/info-cvs