Title: Support the post-rewrite hook type · Issue #2035 · pre-commit/pre-commit · GitHub
Open Graph Title: Support the post-rewrite hook type · Issue #2035 · pre-commit/pre-commit
X Title: Support the post-rewrite hook type · Issue #2035 · pre-commit/pre-commit
Description: It would be useful to me for pre-commit to support the post-rewrite hook: https://git-scm.com/docs/githooks post-rewrite This hook is invoked by commands that rewrite commits (git-commit[1] when called with --amend and git-rebase[1]; how...
Open Graph Description: It would be useful to me for pre-commit to support the post-rewrite hook: https://git-scm.com/docs/githooks post-rewrite This hook is invoked by commands that rewrite commits (git-commit[1] when ca...
X Description: It would be useful to me for pre-commit to support the post-rewrite hook: https://git-scm.com/docs/githooks post-rewrite This hook is invoked by commands that rewrite commits (git-commit[1] when ca...
Opengraph URL: https://github.com/pre-commit/pre-commit/issues/2035
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support the post-rewrite hook type","articleBody":"It would be useful to me for pre-commit to support the `post-rewrite` hook:\r\n\r\nhttps://git-scm.com/docs/githooks\r\n\r\n\u003e post-rewrite\r\nThis hook is invoked by commands that rewrite commits (git-commit[1] when called with --amend and git-rebase[1]; however, full-history (re)writing tools like git-fast-import[1] or git-filter-repo typically do not call it!). Its first argument denotes the command it was invoked by: currently one of amend or rebase. Further command-dependent arguments may be passed in the future.\r\n\r\nMy use-case is automatically running `poetry install` for a project when merging, rebasing, or checking out a different branch. Most of this is possible with the `post-checkout` and `post-merge` hooks, but when rebasing a branch the `post-merge` hook is run before the rebasing applies changes of my branch.\r\n\r\nFor example:\r\n\r\n```\r\n $ git pull origin main\r\nremote: Enumerating objects: 11, done.\r\nremote: Counting objects: 100% (11/11), done.\r\nremote: Compressing objects: 100% (7/7), done.\r\nremote: Total 11 (delta 4), reused 11 (delta 4), pack-reused 0\r\nUnpacking objects: 100% (11/11), 31.67 KiB | 5.28 MiB/s, done.\r\nFrom REDACTED\r\n * branch main -\u003e FETCH_HEAD\r\n 9a12988..36da943 main -\u003e origin/main\r\nFirst, rewinding head to replay your work on top of it...\r\n\r\n###\r\n### The pre-commit hook runs here\r\n###\r\n\r\nInstall dependencies.....................................................Passed\r\n- hook id: poetry install\r\n- duration: 2.83s\r\nInstalling dependencies from lock file\r\nPackage operations: 0 installs, 2 updates, 0 removals\r\n • Updating pytest (6.2.4 -\u003e 6.2.5)\r\n • Updating pre-commit (2.14.0 -\u003e 2.14.1)\r\nInstalling the current project: REDACTED (0.0.1)\r\nInstall pre-commit hooks.................................................Passed\r\n- hook id: pre-commit install\r\n- duration: 0.45s\r\nApplying: REDACTED\r\nApplying: REDACTED\r\n\r\n###\r\n### I would like the pre-commit hook to run here\r\n###\r\n```","author":{"url":"https://github.com/uSpike","@type":"Person","name":"uSpike"},"datePublished":"2021-09-01T17:56:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2035/pre-commit/issues/2035"}
| 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:0310cf60-7ac8-0b0f-467d-3cdc757f92f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E59A:3467D9:65437C:8AB4BC:6A55A32A |
| html-safe-nonce | 2ee8241dfc437c5ef4b3531f428670a1a570c997182088d508b03c7f671dc299 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTlBOjM0NjdEOTo2NTQzN0M6OEFCNEJDOjZBNTVBMzJBIiwidmlzaXRvcl9pZCI6IjI0NTgyOTE5Njg5MzExMTE3MjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3283e244246464359fdb74f9365a09da3ce406b68e1bf1a82b9e213783bd8f0d |
| hovercard-subject-tag | issue:985434505 |
| 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/2035/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a3d7a93f838e632a4c68ea9c9e112f6c67c4627a5d93374f98c14c8a50244227/pre-commit/pre-commit/issues/2035 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3d7a93f838e632a4c68ea9c9e112f6c67c4627a5d93374f98c14c8a50244227/pre-commit/pre-commit/issues/2035 |
| og:image:alt | It would be useful to me for pre-commit to support the post-rewrite hook: https://git-scm.com/docs/githooks post-rewrite This hook is invoked by commands that rewrite commits (git-commit[1] when ca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | uSpike |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 | 653fccf1e27344851c0d3de3fa6faa526197f072 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width