fix: narrow diff to only include changes from the source branch #423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change the logic to show diffs introduced in the source branch, rather than all diffs between the source branch and target. This provides a more focused and accurate analysis of kubechecks proposed changes on PRs.
Additionally, this PR includes minor syntax fixes to the contributing.md document.
The Problem:
Previously, the comparison logic used
git diff origin/main..HEAD
, which would show all accumulated differences between the two branches. This could lead to confusing or irrelevant results, especially ifmain
had moved forward since the feature branch was created.The Solution
this PR updates the
git diff
command to use the triple-dot notation (git diff origin/main...HEAD
). The result is a diff that only includes the changes made in the pull request.this resolves #406
Key Changes:
GetListOfChangedFiles
function to usegit diff ...
for more precise change detection.contributing.md
.NOTE: Please be aware that this change will have no effect if
KUBECHECKS_REPO_SHALLOW_CLONE
is set totrue
. This is because the comparison logic won't be able to find the common base commit, which will result in a full diff being generated