Repository navigation
fix(small-batch): hostname -F (#1526 + #1528 wide-path restore), diff clamp (#1527), ls COLUMNS (#1504), grep --color usage (#1516) - #1534
Conversation
… clamps, #1504 ls COLUMNS, #1516 grep --color usage hostname (#1526): -F/--file reads the hostname from a file; the read goes through the wide extended path (make_api_path_operand().extended) - this also restores the shape #1528 regressed at hostname.cpp:133 back to a narrow ACP-decoded ifstream, matching dircolors/hexdump in the same PR. diff (#1527): OptionalUIntClamp lands in opt.cppm next to the #1528 design slot - overflow clamps to UINT64_MAX like the valued forms, and an attached empty value ("--context=") stores 0, so GNU's "diff runs, rc=1" shape replaces the old arg-error exit 2. --unified=/ --context=/-c<num>/-u<num> all covered. ls (#1504): a non-tty run now honors COLUMNS for -C layout (GNU priority: tty width > COLUMNS > default 80). grep (#1516): an unrecognized --color/--colour value prints the full usage on stdout with EXIT_SUCCESS, no diagnostic - grep.c's COLOR_OPTION shape (covers --color=bogus and the attached empty value, refining #1513). Verification: hostname 11/11, diff 42/42, ls 171/171, grep unit tests green (new cases for each fix); live probes vs WSL GNU grep/diffutils: hostname -F accepts and returns 0, diff --unified=99999999999999999999 clamps and diffs, COLUMNS=40 ls -C lays out two columns, grep --color=bogus -> usage on stdout rc=0.
The i18n-drift gate is a ratchet: deliberate new user-visible strings record their growth in the same PR (check_i18n_drift.py --update-baseline). The three keys are the GNU error shapes this PR introduces: - legacy.904ac09da6d4d139 "diff: Try 'diff --help' for more information." - legacy.9b28a3702b3d6726 "the specified hostname is invalid" - legacy.c9d02dd126c4a836 "name too long" Catalog translation sync follows at release via the tag-triggered sync-i18n-catalog job. Local check now passes: i18n drift OK (24 recorded, none new).
|
Captain review note — i18n-drift failure (now fixed on the branch). The
Resolved via the gate's sanctioned in-PR path ( Two non-blocking notes for the merge:
Code review itself: the four fixes read correctly against GNU (hostname read_file/set_name/check_name pipeline, diff optional-context clamp + |
|
Captain review — verdict: CAN MERGE. I read the full diff (12 files, 1,011 lines) and CI on the new head Content. The four fixes are sound against GNU, each with new unit
CI. The Notes for the merge (not blockers):
Merge decision is the user's / Windows side's — I am not merging. |
Captain dedup note — the ls (#1504) face of this PRWhile reviewing the batch I found that PR #1505 (opened
#1505's CI is fully green after re-running an oracle job that had Recommendation: merge #1505 for the ls face; rebase this PR onto |
The i18n-drift gate is a ratchet: deliberate user-visible string changes record their growth in the same PR (check_i18n_drift.py --update-baseline), per the #1534 precedent. Verified clean at the base revision (24 recorded, none new); this PR grew zh-CN extras by 10: - command.pinky.option.lookup: the invented --lookup option is removed — coreutils 9.4 pinky declares no long options beyond --help/--version (src/pinky.c longopts), so the catalog key the old option carried is now extra. - legacy.0dd8f6031bba80d5 '^[nN]', legacy.1171ad640b28c83c day list, legacy.1ba4ef81e33e6de8 month list, legacy.633616abe53daa05 abday list, legacy.918315ef66894645 'USD ', legacy.af63994c86017ab3 '$', legacy.af63a14c8601884b ',', legacy.af63ac4c86019afc '1', legacy.d4c4e1038c50071b '^[yY]': the locale keyword-value literals moved out of direct safePrintLn calls into the keyword_value() whitelist helper, so scripts/i18n_batch.py's extraction regex (which only scans literals sitting directly inside safePrint calls) no longer sees them. Runtime translation is unaffected — safePrintLn localizes by content digest (translate_legacy) whatever shape the argument takes — so the zh-CN catalog entries stay live; only their extraction visibility changed. Catalog translation sync follows at release via the tag-triggered sync-i18n-catalog job. Local check now passes: i18n drift OK (34 recorded, none new). Refs #1488, #1462
…plets Three CI findings from PR #1561's first run, each traced to root cause: i18n-drift: the 25 new-drift rows are all stale zh-CN keys whose source strings this PR deleted (the 10 C++ bodies + test_expr.hpp, incl. command.readlink/realpath.error.file_name_too_long — the Rust fsutil::reason statics replaced the keyed i18n::format calls). Verified PR-introduced: main tip measures none of them (its CI is green), and the catalog clone carries the keys for text my branch no longer produces. Recorded as deliberate growth with check_i18n_drift.py --update-baseline per the #1534/#1547 precedent; the eventual shrink is the catalog cleanup batch in unixwin/winuxcmd-i18n. baseline (GNU master differential), 2 real mismatches vs the live oracle: - mkdir -m 888 printed the usage Try-hint; GNU mkdir.c:290 treats an invalid mode as a runtime operand error - one stderr line, no hint. mkdir.rs writes the line directly now. - test -f /dev/null returned 0: the operand reaches the library as the NUL DOS device and metadata() succeeds on it; -f now rejects DOS char devices (GNU: char device is not a regular file, rc 1). build-windows x64 ctest, 4 symlink rows the local runner skipped (no symlink privilege) that the CI runner executes: - readlink -f / realpath default / realpath -m on a dangling leaf link (dang -> z_absent_tgt) now resolve the leaf symlink to its target's path (<parent>/z_absent_tgt, rc 0) instead of echoing the link name - AllButLast splices the read_link target onto the canonical parent and folds it lexically; NoCheck does the same over the -m walk; -e keeps failing (probed GNU 9.4). canon unit test pins the class where symlinks are creatable, skips where they are not. - realpath --relative-to: the common-prefix walk compared components case-sensitively, so the CI runner's lowercase-drive ctx.cwd ("d:\...") never matched the canonicalized target's "D:\..." and the output fell back to absolute. Component comparison is now case-insensitive (Windows path spellings are case-variants). pgrep_inverse_excludes_matches failed once on CI and passes on rerun - the #1553 pid-flake family, unrelated. Refs #1488
…plets Three CI findings from PR #1561's first run, each traced to root cause: i18n-drift: the 25 new-drift rows are all stale zh-CN keys whose source strings this PR deleted (the 10 C++ bodies + test_expr.hpp, incl. command.readlink/realpath.error.file_name_too_long — the Rust fsutil::reason statics replaced the keyed i18n::format calls). Verified PR-introduced: main tip measures none of them (its CI is green), and the catalog clone carries the keys for text my branch no longer produces. Recorded as deliberate growth with check_i18n_drift.py --update-baseline per the #1534/#1547 precedent; the eventual shrink is the catalog cleanup batch in unixwin/winuxcmd-i18n. baseline (GNU master differential), 2 real mismatches vs the live oracle: - mkdir -m 888 printed the usage Try-hint; GNU mkdir.c:290 treats an invalid mode as a runtime operand error - one stderr line, no hint. mkdir.rs writes the line directly now. - test -f /dev/null returned 0: the operand reaches the library as the NUL DOS device and metadata() succeeds on it; -f now rejects DOS char devices (GNU: char device is not a regular file, rc 1). build-windows x64 ctest, 4 symlink rows the local runner skipped (no symlink privilege) that the CI runner executes: - readlink -f / realpath default / realpath -m on a dangling leaf link (dang -> z_absent_tgt) now resolve the leaf symlink to its target's path (<parent>/z_absent_tgt, rc 0) instead of echoing the link name - AllButLast splices the read_link target onto the canonical parent and folds it lexically; NoCheck does the same over the -m walk; -e keeps failing (probed GNU 9.4). canon unit test pins the class where symlinks are creatable, skips where they are not. - realpath --relative-to: the common-prefix walk compared components case-sensitively, so the CI runner's lowercase-drive ctx.cwd ("d:\...") never matched the canonicalized target's "D:\..." and the output fell back to absolute. Component comparison is now case-insensitive (Windows path spellings are case-variants). pgrep_inverse_excludes_matches failed once on CI and passes on rerun - the #1553 pid-flake family, unrelated. Refs #1488
Four audited-and-confirmed open issues, fixed in one batch (every fix verified against WSL GNU live probes + new unit cases):
-F/--file: reads the hostname from FILE, GNU semantics, exit 0. The read goes through the wide extended path — restoring the shape winx residuals: captain corrections from #1525 post-merge verification (locate/hostname pins, #1521 past-UINT64 clamp) #1528 regressed at hostname.cpp:133 (narrow ACP ifstream), matching dircolors/hexdump from that same PR. Non-ASCII filename covered by tests.OptionalUIntClamplands in opt.cppm where winx residuals: captain corrections from #1525 post-merge verification (locate/hostname pins, #1521 past-UINT64 clamp) #1528 left the design slot — overflow clamps (rc 1, diff runs), and attached-empty--context=stores 0 per GNU's optional_arg parser. Covers--unified=/--context=/-c<num>/-u<num>.-Clayout now honors COLUMNS (GNU priority: tty width > COLUMNS > 80).--color=bogus: full usage on stdout with EXIT_SUCCESS, no diagnostic (grep.c COLOR_OPTION shape; covers attached-empty too, refining [T1/SH1] bare tail --follow fails 'ambiguous argument' — shared parser collapses bare vs empty OptionalString #1513).Unit tests: hostname 11/11, diff 42/42, ls 171/171, grep green (new cases for all four). Full method and evidence in the commit message.
Context: found and confirmed by the audit sweep (branch audit/full-sweep, AUDIT-REPORT.md) — all four reproduced against GNU before fixing.