Skip to content

Commit d3442e5

Browse files
EliahKaganclaude
andcommitted
DIAG: dump submodule path ownership on Cygwin
Throwaway diagnostic to settle why `test_fixture_dir_is_trusted_by_git[smmap]` passes on Cygwin while `[gitdb]` fails. After `init-tests-after-clone.sh`, dumps `stat`/`getfacl`/gitlink contents for the worktree, .git gitlink, and resolved gitdir of each submodule, then runs `git rev-parse --show-toplevel` both with the full `safe.directory` list and with the gitdb/smmap entries stripped (simulating the pre-fix state). Also drops the 256-job `reproduce-safe-dir` matrix to avoid burning CI for the diagnostic. This branch should be deleted once the data is captured. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8f1348d commit d3442e5

1 file changed

Lines changed: 85 additions & 31 deletions

File tree

.github/workflows/cygwin-test.yml

Lines changed: 85 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,91 @@ jobs:
6767
run: |
6868
./init-tests-after-clone.sh
6969
70+
- name: Diagnose submodule path ownership and safe.directory behavior
71+
run: |
72+
set +e
73+
echo "===================================================================="
74+
echo "Cygwin user identity"
75+
echo "===================================================================="
76+
whoami
77+
id
78+
echo
79+
echo "===================================================================="
80+
echo "Current global safe.directory"
81+
echo "===================================================================="
82+
git config --global --get-all safe.directory
83+
echo
84+
echo "===================================================================="
85+
echo "Path inspection (worktree, .git gitlink, resolved gitdir)"
86+
echo "===================================================================="
87+
for path in \
88+
"$(pwd)" \
89+
"$(pwd)/.git" \
90+
"$(pwd)/git/ext/gitdb" \
91+
"$(pwd)/git/ext/gitdb/.git" \
92+
"$(pwd)/.git/modules/gitdb" \
93+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
94+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
95+
"$(pwd)/.git/modules/gitdb/modules/smmap"; do
96+
echo
97+
echo "--- $path"
98+
ls -ldn "$path" 2>&1 | head -1
99+
stat -c 'uid=%u(%U) gid=%g(%G) mode=%a type=%F' "$path" 2>&1
100+
if [ -f "$path" ]; then
101+
echo "(gitlink content:)"
102+
cat "$path"
103+
echo
104+
fi
105+
getfacl --absolute-names "$path" 2>&1 | sed 's/^/ /' | head -20
106+
done
107+
echo
108+
echo "===================================================================="
109+
echo "Repository discovery (with full safe.directory in place)"
110+
echo "===================================================================="
111+
for fixture in \
112+
"$(pwd)" \
113+
"$(pwd)/git/ext/gitdb" \
114+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
115+
echo
116+
echo "--- git -C $fixture ..."
117+
echo "show-toplevel: $(git -C "$fixture" rev-parse --show-toplevel 2>&1; echo "(rc=$?)")"
118+
echo "git-dir: $(git -C "$fixture" rev-parse --git-dir 2>&1; echo "(rc=$?)")"
119+
echo "absolute-git-dir: $(git -C "$fixture" rev-parse --absolute-git-dir 2>&1; echo "(rc=$?)")"
120+
done
121+
echo
122+
echo "===================================================================="
123+
echo "Repository discovery WITHOUT the gitdb/smmap safe.directory entries"
124+
echo "(simulating the pre-fix workflow state)"
125+
echo "===================================================================="
126+
# Capture the current entries, strip the new ones, restore at the end.
127+
SAVED="$(git config --global --get-all safe.directory)"
128+
git config --global --unset-all safe.directory
129+
echo "$SAVED" | grep -v 'git/ext/gitdb' | while read -r entry; do
130+
[ -n "$entry" ] && git config --global --add safe.directory "$entry"
131+
done
132+
echo "Restricted safe.directory:"
133+
git config --global --get-all safe.directory
134+
echo
135+
for fixture in \
136+
"$(pwd)" \
137+
"$(pwd)/git/ext/gitdb" \
138+
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap"; do
139+
echo
140+
echo "--- git -C $fixture rev-parse --show-toplevel"
141+
git -C "$fixture" rev-parse --show-toplevel
142+
echo "(rc=$?)"
143+
done
144+
# Restore the full safe.directory list.
145+
git config --global --unset-all safe.directory
146+
echo "$SAVED" | while read -r entry; do
147+
[ -n "$entry" ] && git config --global --add safe.directory "$entry"
148+
done
149+
echo
150+
echo "===================================================================="
151+
echo "End diagnostic"
152+
echo "===================================================================="
153+
true # ensure step succeeds even if some commands above returned non-zero
154+
70155
- &git-identity
71156
name: Set git user identity and command aliases for the tests
72157
run: |
@@ -103,34 +188,3 @@ jobs:
103188
- name: Test with pytest (${{ matrix.additional-pytest-args }})
104189
run: |
105190
pytest --color=yes -p no:sugar --instafail -vv ${{ matrix.additional-pytest-args }}
106-
107-
reproduce-safe-dir:
108-
strategy:
109-
matrix:
110-
run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256]
111-
fail-fast: false
112-
113-
runs-on: windows-latest
114-
115-
env: *cygwin-env
116-
117-
defaults: *cygwin-defaults
118-
119-
steps:
120-
- *force-lf
121-
- *checkout
122-
- *install-cygwin
123-
- *verbose-output
124-
- *safe-directory
125-
- *prepare-repo
126-
- *git-identity
127-
- *setup-venv
128-
- *update-pypa
129-
- *install-deps
130-
131-
- name: Run submodule tests
132-
run: |
133-
python -m pytest -vv \
134-
test/test_docs.py::Tutorials::test_submodules \
135-
test/test_repo.py::TestRepo::test_submodules \
136-
test/test_submodule.py::TestSubmodule::test_root_module

0 commit comments

Comments
 (0)