feat: track changed files for commit #200
Open
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.
What does this do / why do we need it?
Commit
struct to track the changed files in the commit.git-chglog
for the Telegraf project and it isn't always guaranteed the scope is added correctly before a pull request is merged. Having the list of changed files can help update the template to get a best guess of the scope. Hopefully other users will also find this useful for potential other use cases?Example template and output
template:
output:
The two output examples are missing the scope in the PR, and we would like it to have been the name of the plugin changed, the idea was for it to be a best guess to save time having to figure it out manually.
How this PR fixes the problem?
When the commit is being parsed in
parseCommit
, I added a call togit diff-tree --no-commit-id --name-only -r commit.Hash.Short
to get the list of changed files and add it to theCommit
struct.Check lists
Thank you for taking a look.