Skip to content

Conversation

ezyang
Copy link
Owner

@ezyang ezyang commented Apr 14, 2025

Stack from ghstack (oldest at bottom):

codemcp/main.py:

Recursively process template directory for template_file in templates_dir.glob("**/*"):

This glob is incorrect; we need to use the same glob pattern that Hatch would use to collect files, importantly, we must respect .gitignore to exclude files here.

55bc199  (Base revision)
14f8494  Add pathspec import for handling gitignore patterns
17cdec0  Add helper function to get files respecting .gitignore
cde369f  Update template processing to respect .gitignore
c35fa81  Auto-commit format changes
HEAD     Auto-commit lint changes

codemcp-id: 254-fix-respect-gitignore-in-template-directory-glob

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Apr 14, 2025
codemcp/main.py:
# Recursively process template directory for template_file in templates_dir.glob("**/*"):
This glob is incorrect; we need to use the same glob pattern that Hatch would use to collect files, importantly, we must respect .gitignore to exclude files here.

```git-revs
55bc199  (Base revision)
14f8494  Add pathspec import for handling gitignore patterns
17cdec0  Add helper function to get files respecting .gitignore
cde369f  Update template processing to respect .gitignore
c35fa81  Auto-commit format changes
HEAD     Auto-commit lint changes
```

codemcp-id: 254-fix-respect-gitignore-in-template-directory-glob
ghstack-source-id: 5c19e81
Pull-Request-resolved: #244
[ghstack-poisoned]
ezyang added a commit that referenced this pull request Apr 14, 2025
codemcp/main.py:
This glob is incorrect; we need to use the same glob pattern that Hatch would use to collect files, importantly, we must respect .gitignore to exclude files here.

```git-revs
55bc199  (Base revision)
14f8494  Add pathspec import for handling gitignore patterns
17cdec0  Add helper function to get files respecting .gitignore
cde369f  Update template processing to respect .gitignore
c35fa81  Auto-commit format changes
21f6c2a  Auto-commit lint changes
2b60bb1  Improve gitignore handling to support nested .gitignore files and directory exclusions
HEAD     Auto-commit format changes
```

codemcp-id: 254-fix-respect-gitignore-in-template-directory-glob
ghstack-source-id: 92d773b
Pull-Request-resolved: #244
[ghstack-poisoned]
@ezyang ezyang closed this in 8c7c75f Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant