Skip to content

pr: treat a page length of exactly 10 as omitting the header - #14045

Merged
cakebaker merged 1 commit into
uutils:mainfrom
luantaraschi:fix/pr-page-length-10
Aug 21, 2026
Merged

pr: treat a page length of exactly 10 as omitting the header#14045
cakebaker merged 1 commit into
uutils:mainfrom
luantaraschi:fix/pr-page-length-10

Conversation

@luantaraschi

Copy link
Copy Markdown
Contributor

pr --help states the rule twice, under -l and under -t: a page length of
10 or less implies -t. pr applies it at < 10 instead, so a page length of
exactly 10 keeps the header and the trailer and then subtracts them from the
page, leaving zero lines for content.

With three lines of input, against GNU coreutils 9.7:

command GNU before after
pr -l 10 -h hdr the 3 lines 3 empty pages, 30 lines, no content the 3 lines
pr -l 10 -t the 3 lines nothing at all the 3 lines
pr -l 10 -T the 3 lines nothing at all the 3 lines
pr -l 9 or pr -l 11 unchanged unchanged unchanged

The -t case drops the input on the floor and still exits 0.

The variable already carries the intended rule in its name, page_length_le_ht,
so this is the comparison catching up with it.

Two differences at -l 10 are not part of this and are still there afterwards:
-F emits a trailing form feed that GNU does not, and -2 lays the columns out
differently. Both reproduce without any -l at all.

Checked against GNU for page lengths 1, 2, 5, 9, 10, 11, 12, 20 and 66, with
-h, -t, -T, -n, -d and -m, on a 3 line and a 40 line input.

Copilot AI lite review requested due to automatic review settings August 20, 2026 19:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.
Skip an intermittent issue tests/tail/tail-n0f (was skipped on 'main', now failing)

@codspeed-hq

codspeed-hq Bot commented Aug 21, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 4.01%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 356 untouched benchmarks
⏩ 50 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation du_summarize_balanced_tree[(5, 4, 10)] 16.1 ms 16.8 ms -4.01%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing luantaraschi:fix/pr-page-length-10 (86618a2) with main (a5a7249)

Open in CodSpeed

Footnotes

  1. 50 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

pr --help states the rule twice, under -l and under -t: a page length of
10 or less implies -t. The comparison used a strict less-than, so a page
length of exactly 10 kept the header and trailer and then subtracted them
from the page, leaving no lines for content. With -h that printed empty
pages, and with -t it printed nothing at all while still exiting 0.

The variable already carried the intended rule in its name.
@cakebaker
cakebaker force-pushed the fix/pr-page-length-10 branch from 01c736e to 86618a2 Compare August 21, 2026 12:29
Copilot AI review requested due to automatic review settings August 21, 2026 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@cakebaker
cakebaker merged commit df30282 into uutils:main Aug 21, 2026
167 of 169 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks for your PR!

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.

3 participants