HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Instructions
Prerequisites for using GIT with github
Please make sure you have your github account, you have properly added your private key such that you are able to use the SSH protocol

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
Check if you have astyle command installed:
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