Title: Alternative to stashing files for testing · Issue #2235 · pre-commit/pre-commit · GitHub
Open Graph Title: Alternative to stashing files for testing · Issue #2235 · pre-commit/pre-commit
X Title: Alternative to stashing files for testing · Issue #2235 · pre-commit/pre-commit
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 s...
Open Graph 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 curr...
X 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 def...
Opengraph URL: https://github.com/pre-commit/pre-commit/issues/2235
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Alternative to stashing files for testing","articleBody":"Are there any plans to implement alternatives to stashing the worktree?\r\n\r\nIdeally 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.\r\n\r\nIn my own pre-commit hooks I use something like:\r\n\r\n git archive \"$(git write-tree)\" --prefix=\"$test_dir/\" | tar xf -\r\n\r\nTo 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...\r\n\r\nEventually 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.\r\n\r\n\r\n","author":{"url":"https://github.com/cehteh","@type":"Person","name":"cehteh"},"datePublished":"2022-02-04T19:57:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2235/pre-commit/issues/2235"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:515dfb7e-1fd5-23b5-18af-ac0053532baf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD7A:2B7730:5F9D837:866EA3C:6A573AE0 |
| html-safe-nonce | 6ead9239a5c1b6434f37a9085e3abe92e3ba208f887640a50d97ee839545f7c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDdBOjJCNzczMDo1RjlEODM3Ojg2NkVBM0M6NkE1NzNBRTAiLCJ2aXNpdG9yX2lkIjoiNTg1NTE4NjM3MDc1MTMxNDY1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1d337afd34e4b2c3060c6509242f569a4ba1658433a41a8cc891e1d01c80b0d9 |
| hovercard-subject-tag | issue:1124566962 |
| github-keyboard-shortcuts | repository,issues,commits,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/2235/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eee3db81a9154677739bc4aab44cf9c4d03234cf738051d669ef0b15af2e275d/pre-commit/pre-commit/issues/2235 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eee3db81a9154677739bc4aab44cf9c4d03234cf738051d669ef0b15af2e275d/pre-commit/pre-commit/issues/2235 |
| og:image:alt | 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 curr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cehteh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| turbo-cache-control | no-preview |
| go-import | github.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git |
| octolytics-dimension-user_id | 6943086 |
| octolytics-dimension-user_login | pre-commit |
| octolytics-dimension-repository_id | 17689377 |
| octolytics-dimension-repository_nwo | pre-commit/pre-commit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17689377 |
| octolytics-dimension-repository_network_root_nwo | pre-commit/pre-commit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width