Skip to content

Conversation

@n0rvyn
Copy link

@n0rvyn n0rvyn commented Jun 24, 2025

Enhanced File Matching for PkgDiff

Description

This PR enhances the file matching capabilities of PkgDiff to better detect renamed and moved files, especially in packages with version numbers embedded in paths. The improvements help identify related files that would otherwise be misclassified as added/removed.

Changes

  • Added path normalization to detect renames/moves where version numbers change in file paths (e.g., lib-1.2/foo.h → lib-1.3/foo.h)
  • Implemented content-based comparison as a fallback matching strategy for otherwise unmatched files
  • Added a new --enhanced-matching option (enabled by default) to control this feature
  • Improved documentation with clear examples of the matching behavior
  • Fixed an issue with double-counting added/removed files when they were moved or renamed

Benefits

  • More accurate change reports between package versions
  • Reduced false positives for added/removed files
  • Better handles common versioning patterns in package structures
  • Maintains backward compatibility with optional flag

Testing

Tested with multiple package formats containing files with version numbers in paths. The enhanced matching correctly identified renamed and moved files that were previously reported as separate additions and removals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant