Skip to content

pr: keep the column separator with -J - #15671

Merged
sylvestre merged 1 commit into
uutils:mainfrom
jayhemnani9910:pr-join-lines-keep-separator
Oct 24, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
jayhemnani9910:pr-join-lines-keep-separator

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

With -J, pr drops the separator between columns and between merged files, so the columns run together:

$ printf '1\n2\n3\n4\n' | pr -2 -t -J -S,
GNU 9.7:  1,3        uutils:  13
          2,4                 24

-J only turns off truncation and column alignment. get_line_for_printing skipped the separator whenever join_lines was set; it now writes it like in the other modes, and the unused join_lines field is gone.

joined.log.expected (-J -m on two files) had the merged lines glued together (# Host DatabaseMon Dec 10 ...); GNU writes a tab between them. The fixture now has that tab and is otherwise unchanged. New test test_join_lines_keeps_column_separator checks -2 -J with and without -S,. Both tests fail on main; the pr tests pass (85), clippy is clean. Also seen on 0.10.0.

-J only turns off truncation and column alignment, as in GNU pr. The separator between columns and merged files was dropped too, so pr -2 -J -S, printed 116 instead of 1,16. The joined.log fixture recorded the glued lines; it now has the tab GNU pr writes between the merged files.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 06:11

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.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.04 MB (-308 KB, -0.19%)

Significant per-binary changes:
  date     2.61 MB ->    2.30 MB  (-316 KB, -11.81%)

@sylvestre
sylvestre merged commit 6f5138a into uutils:main Oct 24, 2026
98 checks passed
@sylvestre

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