fix(ls): preserve permission info as octal when -l/-la is passed#1675
Conversation
📊 Automated PR Analysis
SummaryFixes the Review Checklist
Linked issues: #1672 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
KuSh
left a comment
There was a problem hiding this comment.
Thanks for the PR, that's a great addition but it needs some minor changes first!
KuSh
left a comment
There was a problem hiding this comment.
Thanks for the PR, that's a great addition but it needs some minor changes first!
Addresses PR rtk-ai#1675 review: instead of ignoring the perms field in existing parse_ls_line tests, assert its value so regressions in permission parsing are caught.
KuSh
left a comment
There was a problem hiding this comment.
Hi @ryana-0154, you'll need to resolve conflicts before we can merge that one, otherwise LGTM!
Hi - there doesn't seem to be any merge conflicts to develop - can you confirm? |
Let me recheck, I did have one when I tried earlier |
|
@ryana-0154 there's a conflict, please rebase: ❯ git rebase upstream/develop
Auto-merging src/cmds/system/ls.rs
CONFLICT (content): Merge conflict in src/cmds/system/ls.rs
error: could not apply 39dee40... fix(ls): preserve permission info as octal when -l/-la is passed
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 39dee40... # fix(ls): preserve permission info as octal when -l/-la is passed |
|
You seem to have rebased on the wrong branch (certainly master) you have to fix that. 57 files changed all over the place is too much for the subject 😉 |
Closes rtk-ai#1672 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e0cb485 to
6c4dfc7
Compare
duh... what an idiot :D Fixed! |
Summary
rtk ls -lais equivalent tortk ls, which leads to the loss of some info. #1672 —rtk ls -lawas producing output identical tortk lsbecause the filter stripped permission/ownership entirely.-l(or-la), each entry is now prefixed with octal perms (e.g.644,755), matching the proposal in the issue.4755,1777,7777).rtk ls(no-l) is unchanged.Example
Before:
.DS_Store 6.0K
init.py 984B
After (
rtk ls -la):644 .DS_Store 6.0K
644 init.py 984B
Test plan
cargo fmt --all -- --checkcargo clippy --all-targets— 0 errors (pre-existing warnings unchanged)cargo test --all— 1692 passed, 6 ignoredperms_to_octal(common perms, setuid/setgid/sticky, garbage input) and for long vs. short output formatting