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
IIUC, currently stage_fixed only affects the files originally in the glob. I'm trying to use lefthook for code/documentation generation, and so some steps create/modify files not part of the original staged set/glob results.
Value
Allows using pre-commit for generated files (e.g. documentation)
Behavior and configuration changes
For a silly example, consider a hook that duplicates files:
I initially expected that this would commit both the manually-created file and its backup, but instead it commits the original file and creates the backup but does not stage/commit it. I would like to see a variant of stage_fixed that also adds any files not originally staged for the commit that change during the command.
The text was updated successfully, but these errors were encountered:
Update: I had thought of using git add within the command but found it unreliable; apparently that stemmed from running it inside docker, and moving it outside fixed that. (On the other hand, I've also found that stage_fixed doesn't seem to work reliably for files changed by something running in Docker.)
Staging everything in lefthook is hard to control and you may surprise to commit something you didn't want to. So, explicitly adding files with && git add ... is an options. What issues did you meet when using it?
Running git add from a script running in Docker consistently errored saying that .git/index.lock already exists, despite no other git processes running.
⚡ Summary
IIUC, currently stage_fixed only affects the files originally in the glob. I'm trying to use lefthook for code/documentation generation, and so some steps create/modify files not part of the original staged set/glob results.
Value
Allows using pre-commit for generated files (e.g. documentation)
Behavior and configuration changes
For a silly example, consider a hook that duplicates files:
I initially expected that this would commit both the manually-created file and its backup, but instead it commits the original file and creates the backup but does not stage/commit it. I would like to see a variant of stage_fixed that also adds any files not originally staged for the commit that change during the command.
The text was updated successfully, but these errors were encountered: