Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit d8ea903

Browse files
committed
Update options in vulnerability commands to include new '-r' flag
1 parent 63acade commit d8ea903

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/vulns.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ CRITICAL CVE-2024-1234 lodash 4.17.15 abc1234 2024-03-15 Alice "Add u
9494
HIGH GHSA-xxxx express 4.18.0 def5678 2024-02-01 [bot] "Bump express" [ongoing]
9595
```
9696

97-
Options: `-e`, `-s`, `-b`, `-f`, `--all-time`
97+
Options: `-e`, `-s`, `-r`, `-b`, `-f`, `--all-time`
9898

9999
### praise
100100

@@ -166,7 +166,7 @@ $ git pkgs vulns exposure --all-time --summary
166166
+----------------------------------+
167167
```
168168

169-
Options: `-e`, `-s`, `-b`, `-f`, `--summary`, `--all-time`
169+
Options: `-e`, `-s`, `-r`, `-b`, `-f`, `--summary`, `--all-time`
170170

171171
### diff
172172

@@ -244,7 +244,7 @@ Your exposure:
244244
Fixed: ghi9012 2024-04-01 Bob "Bump lodash for CVE-2024-1234"
245245
```
246246

247-
Options: `-f`, `-b`
247+
Options: `-r`, `-b`, `-f`
248248

249249
## Syncing Vulnerability Data
250250

lib/git/pkgs/commands/vulns/diff.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ def parse_diff_refs(repo)
124124
ref1 = "HEAD~1"
125125
ref2 = "HEAD"
126126
elsif ref2.nil?
127-
ref2 = ref1
128-
ref1 = "HEAD"
127+
# Single ref given: compare FROM that ref TO HEAD
128+
# e.g., `git pkgs vulns diff HEAD~10` shows changes since HEAD~10
129+
ref2 = "HEAD"
129130
end
130131

131132
if ref1.include?("...")

0 commit comments

Comments
 (0)