Repository navigation
prior_context, db: unify unchanged-patch diff equivalence - #885
Merged
Merged
Conversation
patch_diffs_equivalent previously kept lines after the final diff hunk and required a git diff header, while compute_inter_version_diff still compared raw normalized lines with hunk line ranges intact. As a result, rebasing a patch with a new git signature version or base-commit trailer caused patch_diffs_equivalent to report a change, and pure hunk line offset shifts caused compute_inter_version_diff to emit a diff instead of reporting the patch unchanged. Track active hunk line counts during diff normalization so post-diff mail signatures, mailing-list footers, and format-patch metadata trailers (base-commit, prerequisite-patch-id, prerequisite-message-id, and change-id) are stripped outside hunks without truncating deleted lines inside hunks that begin with dashes. Recognize plain unified and Quilt diff header triples alongside git diff headers, and delegate the unchanged test in compute_inter_version_diff to patch_diffs_equivalent. Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
reconcile_patch_lineage previously classified a linked patch as unchanged solely by comparing git_patch_id. Because git patch-id ignores whitespace, indentation fixes in a repost received an unchanged badge in the dashboard while patch_diffs_equivalent and clean-review reuse treated them as modified. Load candidate patch diffs in reconcile_patch_lineage for patches whose git_patch_id appears in both versions, and derive previous_patch_status from patch_diffs_equivalent so lineage badges, prior-version interdiffs, and clean-review reuse share one definition of an unchanged patch. Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Sashiko review✓ No issues found across 2 commits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up on #873 to unify patch-diff equivalence across all three places where Sashiko decides whether a patch changed between revisions:
prior_context: strip post-diff footers and unify interdiff equality@@hunk line counts inextract_normalized_diff_linesso post-diff mail signatures (--), mailing-list footers, andformat-patch/b4trailers (base-commit:,prerequisite-patch-id:,prerequisite-message-id:,change-id:) are stripped outside hunks without truncating deleted hunk lines that begin with-/--.---/+++/@@ -) alongsidediff --githeaders.compute_inter_version_difftopatch_diffs_equivalentso pure hunk line-number shifts report(patch diff unchanged)and modified interdiffs do not include git-version signature diffs.db: usepatch_diffs_equivalentfor patch lineage statusDatabase::reconcile_patch_lineageonly for patches whosegit_patch_idappears in both versions, and deriveprevious_patch_statusfrompatch_diffs_equivalentso whitespace/indentation edits sharing agit_patch_idstill link via Tier 1 while reporting"modified"instead of"unchanged".PriorVersionContextinterdiffs, andskip_unchanged_cleanreview reuse now share a single definition of an unchanged patch.