Skip to content

Commit e3a75d0

Browse files
EliahKaganclaude
andcommitted
Cut xtrace noise from POSIX-ownership diagnostic steps
The "Show POSIX file ownership" step in each test workflow looped over a hard-coded path list with one `ls -ld` per iteration. Bash's xtrace -- active throughout (from `~/.bash_profile` on Cygwin and from the `-x` flag in GHA's default shell line on Ubuntu / macOS / Alpine) -- reprints the entire `for` expression's expanded word list at the start of every iteration. For nine paths that's nine long traces of the same word list, drowning out the `ls -ld` output we want to read. Collapse the loop into a single multi-arg `ls -ld --`: xtrace prints the expanded command line once, `ls` produces one line per existing path and a `ls: cannot access '<path>': No such file or directory` line per missing path. `2>&1` merges those missing-path messages into the log stream alongside the existing-path output; `|| true` keeps the step from failing under `set -e` when any path is missing. The format of missing-path reporting changes from `(missing: <path>)` to `ls: cannot access '<path>': No such file or directory`. Both convey the same information; the new form is slightly more verbose per missing path but eliminates the per-iteration trace reprint that dominated the original output. Cosmetic-only; no change to the diagnostic information surfaced. Flagged on PR #2154 as a follow-up: #2154 (review) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 48f73f8 commit e3a75d0

3 files changed

Lines changed: 9 additions & 15 deletions

File tree

.github/workflows/alpine-test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,15 @@ jobs:
6363
6464
- name: Show POSIX file ownership
6565
run: |
66-
for p in \
66+
ls -ld -- \
6767
"$(pwd)" \
6868
"$(pwd)/.git" \
6969
"$(pwd)/git/ext/gitdb" \
7070
"$(pwd)/git/ext/gitdb/.git" \
7171
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
7272
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
73-
"${HOME:?HOME is not set}/.gitconfig"
74-
do
75-
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
76-
done
73+
"${HOME:?HOME is not set}/.gitconfig" \
74+
2>&1 || true
7775
7876
- name: Show safe.directory entries
7977
# `actions/checkout`'s safe.directory add is only durable for the

.github/workflows/cygwin-test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
# `is_path_owned_by_current_user` reduces to, so this is the view that
9090
# determines whether `safe.directory` is consulted.
9191
run: |
92-
for p in \
92+
ls -ld -- \
9393
"$(pwd)" \
9494
"$(pwd)/.git" \
9595
"$(pwd)/git/ext/gitdb" \
@@ -98,10 +98,8 @@ jobs:
9898
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
9999
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
100100
"$(pwd)/.git/modules/gitdb/modules/smmap" \
101-
"${HOME:?HOME is not set}/.gitconfig"
102-
do
103-
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
104-
done
101+
"${HOME:?HOME is not set}/.gitconfig" \
102+
2>&1 || true
105103
106104
- name: Show NTFS file ownership
107105
# Authoritative NTFS Owner via Get-Acl, with no Cygwin SID-to-uid layer

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,15 @@ jobs:
9494
# not be informative here. The NTFS Owner check below covers Windows.
9595
if: matrix.os-type != 'windows'
9696
run: |
97-
for p in \
97+
ls -ld -- \
9898
"$(pwd)" \
9999
"$(pwd)/.git" \
100100
"$(pwd)/git/ext/gitdb" \
101101
"$(pwd)/git/ext/gitdb/.git" \
102102
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
103103
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
104-
"${HOME:?HOME is not set}/.gitconfig"
105-
do
106-
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
107-
done
104+
"${HOME:?HOME is not set}/.gitconfig" \
105+
2>&1 || true
108106
109107
- name: Show NTFS file ownership
110108
# Windows only. Reads NTFS Owner directly via Get-Acl, which is the

0 commit comments

Comments
 (0)