Repository navigation
Add --kind flag to diff for filtering by manifest/lockfile - #301
Merged
Merged
Conversation
Adds a --kind filter to git-pkgs diff that restricts output to entries from either manifest files or lockfiles, and exposes manifest_kind on each entry in the JSON output. Closes #298
There was a problem hiding this comment.
Pull request overview
This PR adds a --kind manifest|lockfile filter to git-pkgs diff and threads manifest kind information through diff computation so it’s also available in JSON output (manifest_kind). This addresses the request to limit diffs to lockfiles (Issue #298), enabling workflows that only care about installed dependency changes.
Changes:
- Add
--kindCLI flag to filter diff entries by manifest kind (manifestvslockfile). - Include
manifest_kindon eachDiffEntryin JSON output. - Add unit test coverage for filtering diff results by kind and introduce a
manifestmanifest-kind constant.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/diff.go | Adds --kind flag handling, threads ManifestKind into DiffEntry, and extends filtering logic. |
| cmd/diff_test.go | Adds a test verifying kind-based filtering behavior. |
| cmd/constants.go | Defines manifestKindManifest alongside manifestKindLockfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Applying the kind filter to the input dependency lists rather than the computed result means --by ecosystem never merges manifest and lockfile rows into one bucket, so the reported manifest_kind is always correct and a lockfile-only bump can't be masked by a sibling manifest row. Also lowercases the flag value so --kind Lockfile matches.
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.
Adds
--kind manifest|lockfiletogit-pkgs diff, matching the existing--ecosystemand--typefilters. Each diff entry now also carriesmanifest_kindin the JSON output so callers can filter client-side without the flag.The dependency rows already carry
ManifestKindfrom both the database path and the working-tree analyzer, so this just threads it through toDiffEntryand adds the filter check.Closes #298.