Repository navigation
fix(df): align --output columns to GNU widths; never pad the last column (Refs #1657) - #1666
caomengxuan666 wants to merge 2 commits into
Conversation
Review verdict: FAIL (F1 — blocking)PR #1666 (head F1 — new test pins use assertion spellings that don't exist in the test frameworkCI run 43577541076 (CMake Windows Multi-Arch CI), exactly one failing job —
I pulled the failed log myself and confirmed all six errors verbatim; this is not a flake or an environment red. Rework prescription
After rework, the focused re-review must re-run CI to green and run the X299 legs (2 cells green on head, red on base, df ctest suite). Fail-first is deferred — the pins don't compile, so no green/red exists to measure yet. What verified green (product fix itself is mechanism-correct)
Nits / notes (non-blocking)
Merge notesDo not merge on this head. Refs #1657 stays OPEN after any future merge; the captain closes it by hand after the X299 leg. |
队长复核:FAIL(钉文件编不过)build-windows x64 default 红,原因是钉文件本身编译失败(队长读过失败日志原文): 本仓是自定义 harness、非 gtest: |
…fter review FAIL)
fix(df): align --output columns to GNU widths; never pad the last column (Refs #1657)
修了什么
df --output的定制表现在按 GNUdf.c print_table的规则渲染:df.c field_data):source 14、fstype 4、size/used/avail/itotal/iused/iavail 5、pcent/ipcent 4、target/file 0;
列宽 = max(最小宽度,表头宽,最宽 cell),按显示列数计量。
(
MBA_NO_RIGHT_PAD只禁右填充);--total行走同一 printer。src/commands/df.cpp的print_custom_output_table+ 新增output_field_min_width;默认模式渲染器已正确,不动。GNU 语义
df.cfield_data(:177-210):各字段最小宽度与对齐方向。df.cprint_table(:377-408):单空格分隔、末列MBA_NO_RIGHT_PAD。df.c:642/:1256:列宽只向上长,含表头。df.c:488:--output下 avail 表头为 "Avail"(WinuxCmd 现状一致,不改)。验证(Linux,GNU coreutils 9.4 oracle;Windows 腿待复核轮)
tests/unit/df/df_unit_test.cpp):df_output_no_trailing_blanks_and_header_uses_min_width、df_output_last_column_header_not_padded。probes/table_logic_check.cpp):新算法在6 个 GNU 探针形上与 oracle 输出逐字节一致(含 12 列全表与
--total行);旧算法复现 issue 所报形态。7/7 PASS。
实测输出锁定,须由 CI / X299 腿在复核轮实测确认。
删了什么
--output表的空白填充规则:替换的是末列"静默右填充"与"表头按字节宽"的旧行为(与 GNU 有差,见上);
其它输出形态逐点核对不变。无文档/账本改动。
Refs #1657