From 69c8fdb6b9ab61e41440027c48becd9f742134a3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Oct 2025 11:04:58 +0200 Subject: [PATCH] Bug 39877: Force commit id length to 10 The size of the commit id can vary, depending on the git repo. For instance Jenkins had stored results using length of 9 (e9a07fe6a) because it's a shallow clone. But 9 is not enough for our repo: % git rev-list --all | sort | uniq -w 9 -D 29dfcf49f28bb8e75ab4b71a2d68f194928d3de9 29dfcf49f68a2718c0d217921678cd1a0be38ab5 We need to force the length for both commands we use, so commits matched during the comparison. --- Koha/Devel/CI/IncrementalRuns.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Devel/CI/IncrementalRuns.pm b/Koha/Devel/CI/IncrementalRuns.pm index d95dcb45ced..a62becddb9e 100644 --- a/Koha/Devel/CI/IncrementalRuns.pm +++ b/Koha/Devel/CI/IncrementalRuns.pm @@ -129,7 +129,7 @@ sub get_files_to_test { my $dev_files = Koha::Devel::Files->new( { context => $self->{context} } ); my $no_history; if ( $self->{incremental_run} ) { - my @koha_commit_history = qx{git log --pretty=format:"%h"}; + my @koha_commit_history = qx{git log --abbrev=10 --pretty=format:"%h"}; my @tested_commit_history = qx{ls $self->{git_repo_dir}/$self->{test_dir}}; chomp for @koha_commit_history, @tested_commit_history; if (@tested_commit_history) { @@ -169,7 +169,7 @@ sub report_results { return unless $self->{report}; - my $commit_id = qx{git rev-parse --short HEAD}; + my $commit_id = qx{git rev-parse --short=10 HEAD}; chomp $commit_id; my $failure_file = "$self->{git_repo_dir}/$self->{test_dir}/$commit_id"; -- 2.34.1