|
HGCal Test Beam
03a93d6239a951948e06fb3ef8dae4cbdebfad30
|
Download the code:
RELEASE=CMSSW_8_0_1
scram project ${RELEASE}
cd ${RELEASE}/src/
cmsenv
git cms-init
git clone git@github.com:CMS-HGCAL/TestBeam.git HGCal/
scram b -j16
which astyle
If you don't, please install it from http://sourceforge.net/projects/astyle/ and put it into your $HOME/bin directory
Then add the following pre-commit hook into your GIT_DIR:
if [ -d ".git/hooks" ];then
cat > .git/hooks/pre-commit <<EOF
#!/bin/sh
fileList=\`git diff --cached --name-only\`
command="astyle -A3 -t -p -n"
for file in \$fileList
do
case \$file in
*.c | *.cc) \$command \$file; git add \$file;;
*.h | *.hh) \$command \$file; git add \$file;;
*.cpp) \$command \$file; git add \$file;;
esac
done
exit 0
EOF
else
echo "[ERROR] You are not in the main directory of this repository" >> /dev/stderr
fi
Go back to index
1.8.5