Skip to content
Snippets Groups Projects
Commit 1229962d authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

Add scripts to check and apply same format sequence as in MR

parent 723791ea
No related branches found
No related tags found
No related merge requests found
FAIRROOT_FORMAT_BASE=upstream/master
BASE_COMMIT=${FAIRROOT_FORMAT_BASE:-HEAD}
CHANGED_FILES=$(git diff --name-only $BASE_COMMIT | grep -E '.*\.(h|hpp|c|C|cpp|cxx|tpl)$' | grep -viE '.*LinkDef.h$')
if [ -z $GIT_CLANG_FORMAT_BIN ]; then
echo "GIT_CLANG_FORMAT_BIN not defined, trying to use git-clang-format-10 if present"
GIT_CLANG_FORMAT_BIN=git-clang-format-10
fi
$GIT_CLANG_FORMAT_BIN --verbose --commit $BASE_COMMIT $CHANGED_FILES --extensions h,hpp,c,C,cpp,cxx,tpl
git add $CHANGED_FILES
git status
git commit -m"Apply clang-format"
git fetch upstream
FAIRROOT_FORMAT_BASE=upstream/master
BASE_COMMIT=${FAIRROOT_FORMAT_BASE:-HEAD}
CHANGED_FILES=$(git diff --name-only $BASE_COMMIT | grep -E '.*\.(h|hpp|c|C|cpp|cxx|tpl)$' | grep -viE '.*LinkDef.h$')
if [ -z $GIT_CLANG_FORMAT_BIN ]; then
echo "Warning:"
echo "GIT_CLANG_FORMAT_BIN not defined, trying to use git-clang-format-10 if present"
echo ""
GIT_CLANG_FORMAT_BIN=git-clang-format-10
fi
$GIT_CLANG_FORMAT_BIN --commit $BASE_COMMIT --diff $CHANGED_FILES --extensions h,hpp,c,C,cpp,cxx,tpl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment