Skip to content

Add --type filter to diff command#75

Merged
andrew merged 2 commits intomainfrom
add-type-filter-to-diff
Feb 5, 2026
Merged

Add --type filter to diff command#75
andrew merged 2 commits intomainfrom
add-type-filter-to-diff

Conversation

@andrew
Copy link
Contributor

@andrew andrew commented Feb 4, 2026

Adds a --type / -t flag to the diff command to filter output by dependency type (runtime, development, etc.), consistent with the existing flag in the list command.

Changes

  • Added DependencyType field to DiffEntry struct
  • Updated computeDiff to preserve dependency type information
  • Added --type / -t flag for filtering by dependency type
  • Updated text output to show non-runtime types in brackets (e.g., [development])
  • Added dependency_type to JSON output
  • Added test coverage for the new filter

Examples

Filter to show only runtime dependency changes:

$ git pkgs diff --type=runtime

Filter to show only development dependency changes:

$ git pkgs diff --type=development

Relation to #71

This PR addresses part of #71 by making dependency type information available in diff output and adding the ability to filter by type. A future enhancement could add --group-by-type to enable tree-style grouping similar to the example in the issue.

Adds a --type/-t flag to filter diff output by dependency type (runtime,
development, etc.), consistent with the list command.

The diff command now:
- Captures and preserves DependencyType in DiffEntry
- Supports filtering via --type flag
- Displays non-runtime types in brackets (e.g., [development])
- Includes dependency_type in JSON output

This is a step toward addressing #71 by making dependency type
information available in diff output. A future enhancement could add
--group-by-type for tree-style grouping.
@andrew andrew merged commit 961816f into main Feb 5, 2026
4 checks passed
@andrew andrew deleted the add-type-filter-to-diff branch February 5, 2026 11:50
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