Prepare release and bump version numbers to 2.13.0
[TortoiseGit.git] / .gitlab-ci / check-commits.sh
blob0c4a4560e101fc30da6a7453c0f2d3684d9a4dd7
1 #!/bin/bash
2 set -eu -o pipefail
4 founderror=false
5 function error() {
6 echo -en "\e[1;31m";
7 echo "$*"
8 echo -en "\e[0m";
9 founderror=true
12 git fetch $CI_REPOSITORY_URL --shallow-exclude=refs/heads/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME refs/pipelines/$CI_PIPELINE_ID
13 git fetch $CI_REPOSITORY_URL --depth=1 $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
15 git rev-list --reverse FETCH_HEAD..$CI_BUILD_REF | ( while read commit_hash
17 echo "Checking commit $(git show --no-patch --pretty='%h ("%s")' $commit_hash)"
18 git show --no-patch --format=%B $commit_hash | grep -q "Signed-off-by:" || error "Commit $commit_hash does not contain a Signed-off-by line! Please see <https://gitlab.com/tortoisegit/tortoisegit/blob/master/doc/HowToContribute.txt>"
19 done
20 if [[ $founderror != false ]]; then
21 exit 1;
23 ) || founderror=true
25 set +u
27 if [[ $founderror != false ]]; then
28 exit 1;