Skip to content

Commit 2c3b6e3

Browse files
EliahKaganclaude
andcommitted
Show file ownership and safe.directory entries on every test job
Add a step to each workflow that runs the test suite that prints the ownership (NTFS Owner / POSIX uid+gid) of key paths -- the workspace, its `.git`, the gitdb and smmap submodule worktrees and gitfiles, the runner's home directory, and `~/.gitconfig` -- as well as the full list of `safe.directory` entries at that point. GitPython's tests are intentionally coupled to the layout and state of the GitPython repository they run against; ownership and the trust- config that gates whether git will operate on a path are part of that state. Surfacing them in every test job gives diagnostics to read alongside any failure that turns out to be a setup problem rather than a code defect. The step is added to: - `cygwin-test.yml`'s `test` job, with a YAML anchor (`&ownership-display`) so the temporary `reproduce-safe-dir` matrix job can reuse it via `*ownership-display`. - `pythonpackage.yml`'s `test` job (Linux/macOS/Windows-native). - `alpine-test.yml`'s `test` job. It runs after `init-tests-after-clone.sh` has populated the submodules and after `safe.directory` has been configured (in workflows that configure it), so the values reported are what the tests will see. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 98fadf2 commit 2c3b6e3

3 files changed

Lines changed: 62 additions & 0 deletions

File tree

‎.github/workflows/alpine-test.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@ jobs:
6161
. .venv/bin/activate
6262
pip install '.[test]'
6363
64+
- name: Show file ownership and safe.directory entries
65+
run: |
66+
echo "==================== File ownership ===================="
67+
for p in \
68+
"$(pwd)" \
69+
"$(pwd)/.git" \
70+
"$(pwd)/git/ext/gitdb" \
71+
"$(pwd)/git/ext/gitdb/.git" \
72+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
73+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
74+
"${HOME:-}" \
75+
"${HOME:-}/.gitconfig"; do
76+
if [ -n "$p" ]; then
77+
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
78+
fi
79+
done
80+
echo
81+
echo "==================== safe.directory entries ===================="
82+
git config --global --get-all safe.directory 2>&1 || echo "(none)"
83+
6484
- name: Show version and platform information
6585
run: |
6686
. .venv/bin/activate

‎.github/workflows/cygwin-test.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,27 @@ jobs:
9090
run: |
9191
pip install '.[test]'
9292
93+
- &ownership-display
94+
name: Show file ownership and safe.directory entries
95+
run: |
96+
echo "==================== File ownership ===================="
97+
for p in \
98+
"$(pwd)" \
99+
"$(pwd)/.git" \
100+
"$(pwd)/git/ext/gitdb" \
101+
"$(pwd)/git/ext/gitdb/.git" \
102+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
103+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
104+
"${HOME:-}" \
105+
"${HOME:-}/.gitconfig"; do
106+
if [ -n "$p" ]; then
107+
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
108+
fi
109+
done
110+
echo
111+
echo "==================== safe.directory entries ===================="
112+
git config --global --get-all safe.directory 2>&1 || echo "(none)"
113+
93114
- name: Show version and platform information
94115
run: |
95116
uname -a
@@ -192,6 +213,7 @@ jobs:
192213
- *setup-venv
193214
- *update-pypa
194215
- *install-deps
216+
- *ownership-display
195217

196218
- name: Run submodule tests
197219
run: |

‎.github/workflows/pythonpackage.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,26 @@ jobs:
8787
run: |
8888
pip install '.[test]'
8989
90+
- name: Show file ownership and safe.directory entries
91+
run: |
92+
echo "==================== File ownership ===================="
93+
for p in \
94+
"$(pwd)" \
95+
"$(pwd)/.git" \
96+
"$(pwd)/git/ext/gitdb" \
97+
"$(pwd)/git/ext/gitdb/.git" \
98+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
99+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
100+
"${HOME:-}" \
101+
"${HOME:-}/.gitconfig"; do
102+
if [ -n "$p" ]; then
103+
ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)"
104+
fi
105+
done
106+
echo
107+
echo "==================== safe.directory entries ===================="
108+
git config --global --get-all safe.directory 2>&1 || echo "(none)"
109+
90110
- name: Show version and platform information
91111
run: |
92112
uname -a

0 commit comments

Comments
 (0)