This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 9cc7654a6e34 Fix detect-dependencies to use merge-base diff instead of 
two-dot diff
9cc7654a6e34 is described below

commit 9cc7654a6e344c4e476a38343750ba421be14a61
Author: Guillaume Nodet <[email protected]>
AuthorDate: Thu Mar 19 08:33:19 2026 +0100

    Fix detect-dependencies to use merge-base diff instead of two-dot diff
    
    Using `git diff base_branch -- parent/pom.xml` compares the PR branch
    against the tip of the base branch, which includes unrelated changes
    made on main since the branch diverged. This causes dependabot PRs
    that change a single property to appear as if they changed many
    properties, triggering far too many module tests.
    
    Switch to three-dot diff (`git diff base...HEAD`) which compares
    against the merge base, showing only the changes introduced by the PR.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .github/actions/detect-dependencies/detect-test.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/actions/detect-dependencies/detect-test.sh 
b/.github/actions/detect-dependencies/detect-test.sh
index 2362fd16957e..2e86c7b4cbba 100755
--- a/.github/actions/detect-dependencies/detect-test.sh
+++ b/.github/actions/detect-dependencies/detect-test.sh
@@ -38,7 +38,7 @@ TOOLBOX_PLUGIN="eu.maveniverse.maven.plugins:toolbox"
 detect_changed_properties() {
   local base_branch="$1"
 
-  git diff "${base_branch}" -- parent/pom.xml | \
+  git diff "${base_branch}"...HEAD -- parent/pom.xml | \
     grep -E '^[+-][[:space:]]*<[^>]+>[^<]*</[^>]+>' | \
     grep -vE '^\+\+\+|^---' | \
     sed -E 's/^[+-][[:space:]]*<([^>]+)>.*/\1/' | \
@@ -124,7 +124,7 @@ main() {
   git fetch origin "$base_branch":"$base_branch" 2>/dev/null || true
 
   # Check if parent/pom.xml was actually changed
-  if ! git diff --name-only "${base_branch}" -- parent/pom.xml | grep -q .; 
then
+  if ! git diff --name-only "${base_branch}"...HEAD -- parent/pom.xml | grep 
-q .; then
     echo "parent/pom.xml not changed, nothing to do"
     exit 0
   fi

Reply via email to