Skip to content

find: show the file type and special bits in -ls - #892

Open
youdie006 wants to merge 1 commit into
uutils:mainfrom
youdie006:ls-permission-column
Open

youdie006 wants to merge 1 commit into
uutils:mainfrom
youdie006:ls-permission-column

Conversation

@youdie006

Copy link
Copy Markdown

Part of #890.

-ls used its own permission formatter, which only knew directories and regular files and ignored setuid, setgid and sticky bits: symlinks showed ?rwxrwxrwx, /dev/null ?rw-rw-rw- and /tmp drwxrwxrwx. This uses uucore::fs::display_permissions, which -printf %M already uses, and adds an integration test with a 4755 file and a symlink.

Against GNU find 4.9.0 the permission column now matches for every entry in a tree with special modes, a symlink, a broken symlink, a fifo and a socket, and for /dev/null. The missing -> target for symlinks, the date and the block count are unchanged here. cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass.

Written with AI assistance (Claude); I have reviewed the change.

The -ls formatter only knew directories and regular files and ignored
setuid, setgid and sticky bits. Use uucore::fs::display_permissions, as
-printf %M already does.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 02:49

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 reached their quota limit.

@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.34%. Comparing base (331a5c2) to head (bc99f80).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #892      +/-   ##
==========================================
+ Coverage   92.27%   92.34%   +0.06%     
==========================================
  Files          35       35              
  Lines        7576     7527      -49     
  Branches      393      384       -9     
==========================================
- Hits         6991     6951      -40     
+ Misses        443      438       -5     
+ Partials      142      138       -4     

☔ 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.

@codspeed

codspeed Bot commented Oct 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing youdie006:ls-permission-column (bc99f80) with main (331a5c2)

Open in CodSpeed

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Commit bc99f80 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 316 / PASSED: 273 / FAILED: 37 / SKIPPED: 6
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: -1
  PASSED: -1
  FAILED: +0

No result in this run (1) - hung, crashed, or renamed:
  ? posix/flag_comma (was PASS)

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