-
Notifications
You must be signed in to change notification settings - Fork 218
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
Support --all-including-untracked-files
#594
base: master
Are you sure you want to change the base?
Conversation
Hey @sanmai-NL, could you please describe the use case? Why do you need to run lefthook hooks against untracked files? |
@mrexox As a DevOps specialist, I want data generated as part of a CI/CD pipeline to be included in checks orchestrated by Lefthook, so that I can catch suboptimalities in generation source code. As a Developer, I want be able to run Lefthook on my entire working directory even as new content is gradually being added, without having to add and potentially remove new files to the index every time. |
Do you use pre-commit hook for that or a custom hook name? |
A custom hook name. |
PushFiles string = "{push_files}" | ||
SubFiles string = "{files}" | ||
SubAllFiles string = "{all_files}" | ||
SubAllFilesIncludingUntracked string = "{all_including_untracked_files}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sanmai-NL , do you really need this template? Why can't a custom {files}
be used instead?
case r.AllFilesIncludingUntracked: | ||
stagedFiles = r.Repo.AllFilesIncludingUntracked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no need to use {all_including_untracked_files}
template we can move this part to internal/lefthook/run.go
and pass those files via Files
option. I suggested pretty similar solution here
‘All files’ currently means all files in the Git index, so this misses untracked, but unignored additions.
⚡ Summary
☑️ Checklist