From 369ae8f43d2a55dfc3b167615b125b03c925d223 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Thu, 16 Mar 2023 20:17:09 +0000 Subject: tcwg-update-tested.sh: Make "git review" command work again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tcwg-abe-tested jobs have been failing with: + git review -s Creating a git remote called 'gerrit' that maps to: ssh://tcwg-buildslave@review.linaro.org:29418/ci/dockerfiles Traceback (most recent call last): File "/usr/local/bin/git-review", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/git_review/cmd.py", line 1844, in main _main() File "/usr/local/lib/python3.8/dist-packages/git_review/cmd.py", line 1761, in _main set_hooks_commit_msg(remote, hook_file) File "/usr/local/lib/python3.8/dist-packages/git_review/cmd.py", line 382, in set_hooks_commit_msg os.mkdir(hooks_dir) FileExistsError: [Errno 17] File exists: '/dev/null' This happens because repos cloned by Jenkins have the core.hooksPath set to /dev/null causing the git review to fail¹, therefore we need to change the configuration value back to its default value. ¹ https://storyboard.openstack.org/#!/story/2010342 Change-Id: I31f64816568e923aa893fcd9d703ae14319614c5 --- tcwg-update-tested.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcwg-update-tested.sh b/tcwg-update-tested.sh index 286eaebc..332ed27c 100755 --- a/tcwg-update-tested.sh +++ b/tcwg-update-tested.sh @@ -28,6 +28,12 @@ git -C jenkins-scripts push gerrit $GIT_COMMIT_1:refs/heads/tested pushd dockerfiles GIT_COMMIT_2=$(git rev-parse $GIT_COMMIT_2) + +# Repos cloned by Jenkins have the core.hooksPath set to /dev/null, causing the git review +# command to fail (see https://storyboard.openstack.org/#!/story/2010342) so change it +# back to its default value. +git config --unset core.hooksPath + git review -s git checkout -B tcwg-tested origin/tcwg-tested if [ x"$(git diff HEAD $GIT_COMMIT_2 | wc -l)" != x"0" ]; then -- cgit v1.2.3