Add revision headers and description to single-revision diff buffers#60
Add revision headers and description to single-revision diff buffers#60ArthurHeymans wants to merge 2 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 29 minutes and 59 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR adds revision metadata display to diff buffers showing a single target revision. The hook is updated to prepend two new sections—revision headers and revision description—before the diff content. New functions extract revision metadata via jj log queries and render them as collapsible Magit sections. Documentation is updated to reflect the new layout. ChangesRevision Metadata in Diff Buffers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
majutsu-diff.el (1)
578-620: 🏗️ Heavy liftRedundant
jj logsubprocess spawns on every refresh.These two hook inserters each re-run
majutsu-diff--message-revision(onejj logjust to count), and thenmajutsu-insert-diff-revision-headersrunsmajutsu-diff--revision-header-fields(anotherjj log) whilemajutsu-insert-diff-revision-messageruns a third for the description. That is ~4jj loginvocations per diff refresh on a common path, where the count, header fields, and description could be retrieved in a single templated query.Consider resolving the target revision once and fetching the description together with the header fields (the template already collects metadata; add
descriptionand reuse it), then sharing the parsed result between both sections.Want me to draft a consolidated helper that performs a single
jj logquery and feeds both section inserters?🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@majutsu-diff.el` around lines 578 - 620, majutsu-insert-diff-revision-headers and majutsu-insert-diff-revision-message each call majutsu-diff--message-revision and re-run jj log separately; implement a single helper (e.g., majutsu-diff--revision-data) that resolves the target revision once, runs one templated "jj log -r <rev> -T ..." to emit commit-id, author-name, author-email, author-date, committer-name, committer-email, committer-date and description, parses those into a plist or alist, and then have both majutsu-insert-diff-revision-headers and majutsu-insert-diff-revision-message call this helper (and stop calling majutsu-diff--revision-header-fields or re-invoking jj) so headers and message reuse the same parsed result.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@majutsu-diff.el`:
- Around line 578-620: majutsu-insert-diff-revision-headers and
majutsu-insert-diff-revision-message each call majutsu-diff--message-revision
and re-run jj log separately; implement a single helper (e.g.,
majutsu-diff--revision-data) that resolves the target revision once, runs one
templated "jj log -r <rev> -T ..." to emit commit-id, author-name, author-email,
author-date, committer-name, committer-email, committer-date and description,
parses those into a plist or alist, and then have both
majutsu-insert-diff-revision-headers and majutsu-insert-diff-revision-message
call this helper (and stop calling majutsu-diff--revision-header-fields or
re-invoking jj) so headers and message reuse the same parsed result.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69cb57be-4543-4817-a9d4-22d94276e898
📒 Files selected for processing (3)
docs/majutsu.orgdocs/majutsu.teximajutsu-diff.el
a901785 to
f2c5a34
Compare
f2c5a34 to
0d3c750
Compare
Diff buffers scoped to a single target revision now display revision metadata (commit ID, author, committer, bookmarks, remote bookmarks) and the revision description as collapsible Magit sections before the diff content, mirroring the layout of Magit revision buffers.
Key changes:
majutsu-insert-diff-revision-headersto render commit metadata (author, committer, dates, refs) as a collapsiblecommit-headerssectionmajutsu-insert-diff-revision-messageto render the revision description as a collapsiblecommit-messagesection with summary highlightingmajutsu-diff--message-revisionto determine whether the current diff targets a single revision (and thus should show headers/message)majutsu-diff--revision-header-fieldsto fetch and parse revision metadata via a NUL-delimitedjj logtemplate, preserving empty fields correctlymajutsu-diff--format-refsto format local bookmarks and remote bookmarks (excluding thegitremote) with appropriate Magit facesmajutsu-diff-sections-hookso they appear before the diff.organd.texidocumentation to describe the new behaviorSummary by CodeRabbit
New Features
Documentation