Skip to content

Sort diff-driver output by scope as final tiebreaker#218

Merged
andrew merged 1 commit into
mainfrom
fix-diff-driver-scope-sort
May 28, 2026
Merged

Sort diff-driver output by scope as final tiebreaker#218
andrew merged 1 commit into
mainfrom
fix-diff-driver-scope-sort

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented May 28, 2026

PR #166 added scope to each diff-driver output line but the sort comparator in convertLockfile still only considered name and version. When a lockfile lists the same package and version under more than one scope (e.g. Pipfile.lock default + develop, or npm with nested dev/prod copies), those entries compared equal and sort.Slice ordered them however the parser emitted them, so git diff showed hunks where nothing had actually changed.

This adds Scope as the third sort key and a regression test using a Pipfile.lock with packages duplicated across both sections.

Fixes #217

PR #166 added scope to each output line but the sort comparator still
only considered name and version. When a lockfile lists the same
package and version under more than one scope (e.g. Pipfile.lock
default + develop), those entries compared equal and sort.Slice ordered
them however the parser emitted them, producing spurious diff hunks.

Fixes #217
@andrew andrew merged commit 2abff90 into main May 28, 2026
7 checks passed
@andrew andrew deleted the fix-diff-driver-scope-sort branch May 28, 2026 13:36
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.

Non-deterministic deps sorting

1 participant