-
-
Notifications
You must be signed in to change notification settings - Fork 909
Description
Are there any plans to implement alternatives to stashing the worktree?
Ideally this would be hook/scriptable, like some 'prepare-worktree' and 'restore-worktree' options (which default to the current stash behavior) but can also yield some new directory where the tests are run. The rationale here is that my editor reverts files changed on disk and I'd like to add notes to source files while the commit is in progress.
In my own pre-commit hooks I use something like:
git archive "$(git write-tree)" --prefix="$test_dir/" | tar xf -
To create a pristine source tree (actually, I also prime it with cp -rl with build artifacts from the previous build to speed up incremental builds). 'git-worktree' and other tools could be used as well...
Eventually I have the idea to run some (more expensive) pre-commit checks in the background while one types the commit message. Then in the commit-msg hook wait for the background results and abort the commit there. This should reduce the turn around times significantly.