Move .gitignore creation from init to logs download#13749
Merged
Conversation
- Remove .gitignore creation from init command (initializeBasicRepository and InitRepository functions) - Add .gitignore creation to logs download orchestrator (DownloadWorkflowLogs function) - Update init command help text to remove mention of .gitignore creation - Update init tests to no longer expect .gitignore file creation - .gitignore file is now created on every logs download invocation, not eagerly during init Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
approved these changes
Feb 4, 2026
Copilot
AI
changed the title
[WIP] Ensure .gitignore file is generated for logs directory
Move .gitignore creation from init to logs download
Feb 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves the generation of .github/aw/logs/.gitignore from the init command to the logs download command, ensuring the file is created on every logs download invocation rather than only during repository initialization.
Changes:
- Removed
.gitignorecreation from bothinitializeBasicRepositoryandInitRepositoryfunctions in init.go - Added
.gitignorecreation at the beginning ofDownloadWorkflowLogsin logs_orchestrator.go with graceful error handling - Updated init command help text to remove mention of
.gitignorecreation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/logs_orchestrator.go | Added call to ensureLogsGitignore() at the start of DownloadWorkflowLogs with non-critical error handling |
| pkg/cli/init.go | Removed ensureLogsGitignore() calls from both initializeBasicRepository and InitRepository functions |
| pkg/cli/init_command.go | Updated help text to remove mention of .gitignore creation for logs directory |
| pkg/cli/init_test.go | Removed test assertions that checked for .gitignore file creation, added comments explaining the change |
| pkg/cli/init_command_test.go | Removed test assertion that checked for .gitignore file creation in init tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The
.github/aw/logs/.gitignorefile was created eagerly duringgh aw init, requiring users to run init before downloading logs. Now created lazily on everygh aw logsinvocation.Changes
pkg/cli/init.go: RemovedensureLogsGitignore()calls frominitializeBasicRepository()andInitRepository()pkg/cli/logs_orchestrator.go: AddedensureLogsGitignore()at start ofDownloadWorkflowLogs()- errors logged but non-blockingpkg/cli/init_command.go: Removed.gitignorecreation from help textImplementation
The
ensureLogsGitignore()function remains unchanged - idempotent check-and-create logic inpkg/cli/git.go.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.