From e3a75d0bf38616fbbf3029d540965506003531d8 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sat, 23 May 2026 13:36:58 -0400 Subject: [PATCH] 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 '': 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: )` to `ls: cannot access '': 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: https://github.com/gitpython-developers/GitPython/pull/2154#pullrequestreview-4307636857 Co-authored-by: Claude Opus 4.7 (1M context) --- .github/workflows/alpine-test.yml | 8 +++----- .github/workflows/cygwin-test.yml | 8 +++----- .github/workflows/pythonpackage.yml | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/alpine-test.yml b/.github/workflows/alpine-test.yml index 4183f0e0d..5c999e487 100644 --- a/.github/workflows/alpine-test.yml +++ b/.github/workflows/alpine-test.yml @@ -63,17 +63,15 @@ jobs: - name: Show POSIX file ownership run: | - for p in \ + ls -ld -- \ "$(pwd)" \ "$(pwd)/.git" \ "$(pwd)/git/ext/gitdb" \ "$(pwd)/git/ext/gitdb/.git" \ "$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \ "$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \ - "${HOME:?HOME is not set}/.gitconfig" - do - ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)" - done + "${HOME:?HOME is not set}/.gitconfig" \ + 2>&1 || true - name: Show safe.directory entries # `actions/checkout`'s safe.directory add is only durable for the diff --git a/.github/workflows/cygwin-test.yml b/.github/workflows/cygwin-test.yml index c12ccb3cf..17ba4bc82 100644 --- a/.github/workflows/cygwin-test.yml +++ b/.github/workflows/cygwin-test.yml @@ -89,7 +89,7 @@ jobs: # `is_path_owned_by_current_user` reduces to, so this is the view that # determines whether `safe.directory` is consulted. run: | - for p in \ + ls -ld -- \ "$(pwd)" \ "$(pwd)/.git" \ "$(pwd)/git/ext/gitdb" \ @@ -98,10 +98,8 @@ jobs: "$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \ "$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \ "$(pwd)/.git/modules/gitdb/modules/smmap" \ - "${HOME:?HOME is not set}/.gitconfig" - do - ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)" - done + "${HOME:?HOME is not set}/.gitconfig" \ + 2>&1 || true - name: Show NTFS file ownership # Authoritative NTFS Owner via Get-Acl, with no Cygwin SID-to-uid layer diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index cffafc59a..6746b92c6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -94,17 +94,15 @@ jobs: # not be informative here. The NTFS Owner check below covers Windows. if: matrix.os-type != 'windows' run: | - for p in \ + ls -ld -- \ "$(pwd)" \ "$(pwd)/.git" \ "$(pwd)/git/ext/gitdb" \ "$(pwd)/git/ext/gitdb/.git" \ "$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \ "$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \ - "${HOME:?HOME is not set}/.gitconfig" - do - ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)" - done + "${HOME:?HOME is not set}/.gitconfig" \ + 2>&1 || true - name: Show NTFS file ownership # Windows only. Reads NTFS Owner directly via Get-Acl, which is the