Skip to content

list: show numeric owners and pad the size column like GNU tar in -tv - #421

Open
jayhemnani9910 wants to merge 1 commit into
uutils:mainfrom
jayhemnani9910:list-verbose-owner-width
Open

jayhemnani9910 wants to merge 1 commit into
uutils:mainfrom
jayhemnani9910:list-verbose-owner-width

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

Two differences in tar -tvf from GNU tar 1.35:

  • an entry without user and group names lists as / instead of the numeric ids. Archives created by this tar carry no names, so listing them shows
    -rw-rw-r-- /        2 2020-01-01 00:00 f        # GNU: -rw-rw-r-- 1000/1000         2 2020-01-01 00:00 f
    
  • the size is padded to 8 columns. GNU keeps owner/group size 19 columns wide and, after an entry that needs more, keeps the wider column for the rest of the listing:
    -rw-r--r-- po/po             2 1970-01-01 00:00 named.txt
    -rw-r--r-- averyveryverylongusername/gg 2 1970-01-01 00:00 long.txt
    -rw-r--r-- po/po                        2 1970-01-01 00:00 after.txt
    

format_verbose_entry now falls back to the uid and gid when a name is empty, and list_archive keeps the column width across entries (starting at 19, growing to fit), with the size right-aligned in what is left after owner/group .

New test test_list_verbose_owner_and_size_columns uses GNU tar's output for the same archive (fails on main). cargo test --workspace: test_tar 69 pass (68 on main), cargo clippy --workspace --all-targets clean. Listed six archives (made by GNU tar, by this tar, with a 200 KB file, with a long owner name, and with names and ids mixed) with GNU tar and with this branch: identical output.

Independent of the open -v extract change (different file).

An entry without user and group names listed as '/', and the size was
padded to 8 columns. GNU tar falls back to the ids and keeps the
'owner/group size' column 19 wide, widening it for longer entries.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 03:03

Copilot AI left a comment

Copy link
Copy Markdown

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 insufficient remaining quota.

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.

@codspeed

codspeed Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 7 untouched benchmarks


Comparing jayhemnani9910:list-verbose-owner-width (9954549) with main (13e7b00)

Open in CodSpeed

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (791ae26) to head (9954549).
⚠️ Report is 106 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   96.84%   98.28%   +1.43%     
==========================================
  Files          11       15       +4     
  Lines        1492     2046     +554     
  Branches       29       41      +12     
==========================================
+ Hits         1445     2011     +566     
+ Misses         46       34      -12     
  Partials        1        1              
Flag Coverage Δ
macos_latest 98.28% <100.00%> (+1.43%) ⬆️
ubuntu_latest 98.28% <100.00%> (+1.43%) ⬆️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants