-
Notifications
You must be signed in to change notification settings - Fork 13
Add untracked CHANGELOG.md files to git before commit #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Related to #5 |
|
@copilot Instead of checking for existence of files at lock-acquisition time, check for the presence of the file in the git index instead. Note that the lookup requires a worktree-relative slash-separated path, and |
Changed to check the git index instead of file existence. In commit f49d22f:
|
|
@copilot This git index check should be done at the time when it decides if |
Moved the git index check to |
Previously it would fail if the changelogs were new, now we auto-add it if it's not yet tracked. Co-authored-by: Byron <[email protected]>
b977b5a to
45d1be9
Compare
45d1be9 to
10c7a3e
Compare
git commit -amonly stages tracked files, so newly created CHANGELOG.md files were not included in release commits.Changes Made
src/command/release/git.rs:commit_changes()now accepts a list of changelog paths, checks the git index internally to determine which ones are untracked, and runsgit add --on them beforegit commit -amsrc/command/release/manifest.rs: Collect all changelog paths before they are consumed and pass them tocommit_changes()Implementation Details
ctx.repo.open_index()to access the git indexrepo.workdir()gix::path::to_unix_separators(gix::path::into_bstr())index.entry_by_path()to check if a file is tracked in the indexgit addfor paths that are not in the indexTesting
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.