You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pre-commit detects changes made by hooks to the files in the repo. It'd be useful to have the option to print the changed files, as it's not always easy to make the tool we're running underneath do that for us.
My usage scenario would be having a scalafmt hook (a source formatter). Scalafmt doesn't output the files it modified, and has no option of requesting that.
I think though this is a generally useful feature, as many tools will be lacking in a similar way. Hence I propose print_changed_files: true to enable printing of the files changed by a hook.
The text was updated successfully, but these errors were encountered:
there's a duplicate for this somewhere in the tracker -- maybe #681, we don't actually know the changed filenames without a complicated and slow lookup (we're currently using "does the git diff bytes change between invocations)
you can run git diff afterwards to kind of find the changes?
Yeah, I thought pre-commit actually knows which files changed - but you've explained it doesn't.
I think what I'm looking for with this and #1086 is better suited to be done in a post-commit hook (mostly). So I ended up running the formatter in a post-commit hook, and making a fixup! commit with its changes. This:
Pre-commit detects changes made by hooks to the files in the repo. It'd be useful to have the option to print the changed files, as it's not always easy to make the tool we're running underneath do that for us.
My usage scenario would be having a scalafmt hook (a source formatter). Scalafmt doesn't output the files it modified, and has no option of requesting that.
I think though this is a generally useful feature, as many tools will be lacking in a similar way. Hence I propose
print_changed_files: true
to enable printing of the files changed by a hook.The text was updated successfully, but these errors were encountered: