aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-01-19 07:48:40 -0500
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-01-19 18:06:56 +0000
commit0729f96fdd250af14b3c0672db0b72997f39bf53 (patch)
treeef2d7e40c6a00881214de43e3e0ad8e2e17ad8dd /.gitlab-ci.yml
parent73b94e7aef0a96fd575c88a06f20335763ff796a (diff)
GitLab CI: Fix Commit Check gitrevision for multiple commits
commit^N means the Nth parent of a commit object (after a merge, for example.) It is not the same as the Nth generation ancestor (following only the first parents), which is commit~N, or alternatively commit^^^^^ (N times), or even commit^1^1^1.... (See 'man gitrevisions' for details.) When the number of commits is N, we want the Nth generation ancestor. Fixes error messages like: fatal: ambiguous argument 'HEAD^3': unknown revision or path not in the working tree.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml2
1 files changed, 1 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0d93608f52..6688b47b26 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -532,7 +532,7 @@ Commit Check:
script:
# build-ubuntu puts us in `build`.
- cd ..
- - bash ./tools/pre-commit "HEAD^$NUM_COMMITS"
+ - bash ./tools/pre-commit "HEAD~$NUM_COMMITS"
- tools/validate-commit.py
# Rely on fedora:latest and debian-stable jobs for testing a recent GCC version.