feat(commits): show commit signature verification badges#274
Merged
Conversation
Adds %G? and %GS to git log parsing, a SignatureStatus on Commit, and a badge in the commits and log panels plus the signer in the commit detail. Closes #270. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
signatureDetail is called by Panel.showDetail (already allowlisted; reachable via action dispatch deadcode cannot trace), so add it to the same commits helper section of the deadcode allowlist. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
What this does
Surfaces GPG and SSH signature verification status in the commit list, the log graph, and the commit detail view. Signed commits now carry a small badge so you can tell a verified commit from an unsigned one or one with a bad signature without dropping to the command line.
Closes #270.
How it works
flowchart LR A[git log with %G? and %GS] --> B[parseLogOutput sets Commit.Signature] B --> C{Status} C -- good --> D[check badge, green] C -- bad --> E[cross badge, red] C -- unknown, expired, revoked, error --> F[warning badge, yellow] C -- none --> G[no badge] D --> H[commits and log rows] E --> H F --> H H --> I[commit detail shows signer]Changes
internal/git:Logrequests%G?and%GS;parseLogOutputfills a newCommit.Signature(aSignatureStatus) andCommit.Signer. Reading is defensive so legacy 9-field records still parse.internal/panels/commitrender: optionalShowSignatureprefixes the subject with a badge. Glyphs follow the icon guidelines (check, cross, warning) and color comes from the theme.internal/panels/commitsandinternal/panels/gitlog: enable the badge and wire theme colors. The commits detail view shows the signer identity.Tests
%G?code into the right status, plus 11-field and legacy 9-field records.Notes
The badge is passive, so there is no new keybinding. Color is applied through lipgloss, not baked into the glyph.