Open
Conversation
Member
|
That's about what I had in mind too. I would, though, create a "hook.lua" file with a The second arg can be an optional table of arguments to pass into the hook function. |
4de8583 to
503f93c
Compare
Author
|
Changes since last push:
|
503f93c to
05307b1
Compare
Author
|
I implemented the remaining events as hooks. The commits can be squashed later. I assumed separate commits would be easier to review. |
7cd2303 to
774ffb6
Compare
KirkEasterson
commented
Mar 14, 2026
774ffb6 to
7390e7d
Compare
Author
|
I wasn't certain about where to call some hooks. Some calls can be moved a few lines while others can be moved to different functions. |
ceb559c to
1b82ecc
Compare
Author
|
I've updated the PR with documentation. |
5590b4f to
b310c20
Compare
A hook for the "cmd" and "finished" bisect was omitted. It would have no difference compared to the event.
b310c20 to
adab5b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a POC for hooks as requested in #1909. This PR will remain a draft during the iteration and planning phase. Once an approach is agreed upon, then this PR will be cleaned up to be a candidate for merging.
I am not fluent in lua, so please be critical with coding standards.
Testing done:
I've run this locally on my own config to solve the problem from the aforementioned issue. I added the following to my neogit config:
The function body can be replaced with
print("Running PreBranchCheckout")for a simple verification.Neovim versions tested on:
OSes tests on:
Remaining work:
PreStatusRefreshedPreCommitCompletePrePushCompletePrePullCompletePreFetchCompletePreBranchCreatePreBranchDeletePreBranchCheckoutPreBranchResetPreBranchRenamePreRebasePreResetPreTagCreatePreTagDeletePreCherryPickPreMergePreStashRefsRefreshedDiffLoadedBisectWorktreeCreate