-
-
Notifications
You must be signed in to change notification settings - Fork 242
feat: overhaul repo watcher #1409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
046a79b
to
1e67439
Compare
- Fix issue of watcher callback not being called when running with Watchman due to filename ignore check being done in the debounced section of the handler. - Only update abbrev_head when `.git/HEAD` is changed - Reduce watcher timer debounce interval to 200ms. - Add handwritten implementation of `git rev-parse --abbrev-ref HEAD` which reads `.git/HEAD` directly.
1e67439
to
ac2962f
Compare
Unfortunately here I still can get outdated hunk signs (staging works) and still cannot find how to reproduce it. |
Try looking at the debug messages, and see what events are getting picked up. This patch now explicitly marks when events are ignored. |
This time I caught it when staging some untracked file, but previously got it also on versioned files. Staging/unstaging hunks action caused appending added lines to the stage (not checked what happens if there are deletions too):
diff --git a/after/queries/make/indents.scm b/after/queries/make/indents.scm
new file mode 100644
index 0000000..45ca848
--- /dev/null
+++ b/after/queries/make/indents.scm
@@ -0,0 +1,12 @@
+[
+ (rule)
+ ] @indent.begin
+[
+ (rule)
+ ] @indent.begin
+[
+ (rule)
+ ] @indent.begin
+[
+ (rule)
+ ] @indent.begin Debug messages (offtopic: notice checking extui buffers):
I don't know if it may be relevant: this time it occurred on a submodule with "absorbed" git dir. |
Doesn't look like the file watcher triggered even once. To confirm your issue is getting signs not applied when doing git operations outside of the editor? |
Not this time, but I keep in mind that it's a separate case (also hard to catch in any repeatable way), usually by vim.system calls or similar (diffview f.e.). Debian Sid was used here as usually. |
Another offtopic comment related to extui: disabled gitsigns.nvim/lua/gitsigns/debug/log.lua Line 217 in f780609
|
This pr only changes the code for the file system watcher. I don't know what your issue is, as the info provided so far is quite vague, but it seems it's unlikely related to what is attempted to be fixed here. If you notice something more concrete, please raise it as a separate issue. Incorrectly attributing it to other issues, makes it extremely difficult to debug anything. |
The debug messages can also be retrieved as a Lua object. |
Driving this locally, going well so far 🎉 ❤️ |
Fix issue of watcher callback not being called when running
with Watchman due to filename ignore check being done in the
debounced section of the handler.
Only update abbrev_head when
.git/HEAD
is changedReduce watcher timer debounce interval to 200ms.
Add handwritten implementation of
git rev-parse --abbrev-ref HEAD
which reads
.git/HEAD
directly.