Skip to content

[repo-assist] fix(diff): add --no-pager and package header to git diff (#1243) - #2905

Merged
Jguer merged 3 commits into
nextfrom
repo-assist/fix-issue-1243-diff-pagination-61a83cc10996b596
Jul 19, 2026
Merged

[repo-assist] fix(diff): add --no-pager and package header to git diff (#1243)#2905
Jguer merged 3 commits into
nextfrom
repo-assist/fix-issue-1243-diff-pagination-61a83cc10996b596

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist.

Summary

Fixes the inconsistent pagination of PKGBUILD diffs when reviewing multiple packages (issue #1243).

Root cause: showPkgbuildDiffs called cmdBuilder.Show() with a bare git diff command for each package. git by default invokes a pager (e.g. less) when output exceeds the terminal height, but does not invoke it for short diffs. This caused different packages to behave differently: large diffs opened less individually, small diffs just scrolled past.

Changes

  • Add --no-pager before diff in the git args. This prevents git from opening its own pager per package; all diffs now stream consistently to stdout regardless of length.
  • Print a package name header (==> Showing diff for <pkg>) before each diff. When reviewing multiple packages, users can now clearly see where each package's diff begins.

Trade-offs

  • Diffs from all packages now scroll to the terminal. Users who want to page through the combined output can set PAGER=less or pipe yay through a pager. This is consistent, predictable behaviour compared to the current inconsistent per-diff paging.
  • The maintainer has noted a jguer/skip-confirmed-confirms branch exploring config-driven behaviour; the --no-pager approach is the simplest fix and doesn't conflict with that work.

Test Status

⚠️ Infrastructure limitation: the workflow runner has Go 1.25 but the module requires Go ≥ 1.26, so automated build and test could not be run. The change is small (3 lines): adding "--no-pager" to an existing string slice and adding one logger.Println call. Both are consistent with surrounding code patterns.

Closes #1243

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@1c6668b751c51af8571f01204ceffb19362e0f66

Previously, each package's diff was shown via a separate `git diff`
invocation with Show(), allowing git to invoke its own pager (e.g. less)
independently for each package. This caused inconsistent pagination:
large diffs opened a pager, small diffs scrolled past in the terminal.

Changes:
- Add --no-pager flag to git diff so git doesn't open its own pager
  per package; all diffs now stream consistently to stdout.
- Print a package name header before each diff so users can easily
  identify which package each diff belongs to when reviewing multiple
  packages.

Closes #1243

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Jguer
Jguer marked this pull request as ready for review July 18, 2026 23:59
@Jguer
Jguer self-requested a review as a code owner July 18, 2026 23:59
@Jguer
Jguer merged commit 45964c4 into next Jul 19, 2026
7 checks passed
@Jguer
Jguer deleted the repo-assist/fix-issue-1243-diff-pagination-61a83cc10996b596 branch July 19, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git diffs use pagination inconsistently

1 participant