Skip to content

Commit f2d7774

Browse files
torrmalclaude
andcommitted
Keep duplicate "<file> 2" copies out of commits
Something on this machine generates byte-identical copies named "<file> 2.go", "<file> 3.py" and so on, across build output, virtualenvs and source trees alike — 1,277 of them were cleaned out of ~/Documents/GitHub in one pass, 190 MB worth, including ten Python modules shadowing their originals in another repo. Two landed in internal/agent during a session here and broke the build with redeclaration errors, which is how they were noticed at all. The cause is still unknown. It is not iCloud: ~/Documents is not synced, the symlink in CloudDocs points the other way, and no file carries an iCloud attribute. This only keeps them out of commits. It does not stop the build breaking, because the file is still on disk and the compiler still reads it — so the comment says where to look when a build fails for no reason. The pattern is broad enough to catch a legitimately named "Chapter 2.md", which is a fair trade in a Go repository that has no such file and cannot tolerate the ones it does get. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent bb7d00e commit f2d7774

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,13 @@ go.work.sum
3030
# Editor/IDE
3131
# .idea/
3232
# .vscode/
33+
34+
# Duplicate copies named "<file> 2.go", "<file> 3.py" and so on. Something
35+
# on this machine generates them across build output, virtualenvs and
36+
# source trees alike — 1,277 identical ones were cleaned out of
37+
# ~/Documents/GitHub in one pass. A stale copy beside a real .go file
38+
# breaks the build with redeclaration errors, so this keeps them out of
39+
# commits at least. It does not stop the build breaking: the file is still
40+
# on disk and the compiler still reads it. `find . -name '* [0-9]*'` finds
41+
# them when a build fails for no apparent reason.
42+
* [0-9]*

0 commit comments

Comments
 (0)