Skip to content

fix(tar,ls): tar -P/-T/--, ls quoting styles (-b, -N, -Q, --quoting-style) - #2559

Merged
chaliy merged 1 commit into
mainfrom
claude/tar-ls-gaps
Oct 7, 2026
Merged

chaliy merged 1 commit into
mainfrom
claude/tar-ls-gaps

Conversation

@chaliy

@chaliy chaliy commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Requested by Михайло · project thread

What changed

  • tar -P / --absolute-names keeps the leading / and skips the "Removing leading" notice.
  • tar -T FILE / --files-from=FILE reads member names, one per line. Blank lines are skipped and - reads stdin.
  • tar -- ends option parsing, so tar -cf x.tar -- -v archives a file named -v.
  • ls supports the GNU quoting styles: -b/--escape, -N, -Q, and --quoting-style=literal|escape|c|shell|shell-always|shell-escape|shell-escape-always.
    • It follows GNU's rules, including "it's" in shell style and directory headers left unescaped under -b.
    • locale/clocale still report "not implemented".
  • Fixed a missing ### end in tar.test.sh, so tar_strip_components runs as its own case again.

Why

Gap telemetry flagged invalid option -- 'P', 'T' and '-' from tar, plus ls -b, in replayed agent calls.

Before

$ tar -cPf x.tar /tmp/f
tar: invalid option -- 'P'
$ ls -b
ls: option(s) not yet implemented in bashkit: escape

After

$ tar -cPf x.tar /tmp/f && tar -tPf x.tar
/tmp/f
$ ls -b; ls --quoting-style=shell
a\ b
'a b'

New and updated cases in tar.test.sh and ls.test.sh match real bash 5.2 with GNU coreutils/tar. The quoting styles also have a unit test, ls::quoting::tests::styles_match_gnu, covering control-char escapes, which the VFS keeps out of file names.

Risk

Low. The default ls style (literal) is unchanged. The tar writers now take a small TarNames struct instead of two bools.

Checklist

  • Failing specs first, verified against bash
  • cargo test -p bashkit --lib --tests, clippy, fmt
  • docs/compatibility.md, knowledge/log.md

https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA


Generated by Claude Code

@chaliy chaliy self-assigned this Oct 7, 2026
…tyle)

tar keeps absolute names with -P/--absolute-names, reads member lists
from -T/--files-from (- is stdin), and stops option parsing at --.
ls renders names in GNU escape, c, literal and shell* quoting styles.

Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
@chaliy
chaliy force-pushed the claude/tar-ls-gaps branch from 736c6ab to 6a1fed0 Compare October 7, 2026 12:29
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 6a1fed0 Commit Preview URL

Branch Preview URL
Oct 07 2026, 12:29 PM

@chaliy
chaliy merged commit d155c1d into main Oct 7, 2026
47 checks passed
@chaliy
chaliy deleted the claude/tar-ls-gaps branch October 7, 2026 12:49
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.

1 participant