fix: respect .gitignore in template directory glob#244
Closed
ezyang wants to merge 3 commits intogh/ezyang/187/basefrom
Closed
fix: respect .gitignore in template directory glob#244ezyang wants to merge 3 commits intogh/ezyang/187/basefrom
ezyang wants to merge 3 commits intogh/ezyang/187/basefrom
Conversation
This was referenced Apr 13, 2025
Closed
Closed
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
codemcp-id: 254-fix-respect-gitignore-in-template-directory-glob