Skip to content
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

"file modified by an external process" is noisy #10657

Open
tgross35 opened this issue May 2, 2024 · 2 comments · May be fixed by #10662
Open

"file modified by an external process" is noisy #10657

tgross35 opened this issue May 2, 2024 · 2 comments · May be fixed by #10662
Labels
C-enhancement Category: Improvements

Comments

@tgross35
Copy link

tgross35 commented May 2, 2024

A lot of times I switch git branches without relaunching/reloading helix. Then upon attempting to write, it informs me that the file has been modified by an external process. The problem is that this gets emitted even if only the file timestamp changes, regardless of whether or not the file contents actually changed.

Instead, if Helix notices a timestamp change then there should be a fallback method, such as a hash of the file contents, to determine whether or not writing needs to be blocked and this message shown. sha1_smol would probably work well enough and is already in the dependency graph, or blake3 would be faster since it leverages mmap and parallelization.

@tgross35 tgross35 added the C-enhancement Category: Improvements label May 2, 2024
@TornaxO7
Copy link
Contributor

TornaxO7 commented May 2, 2024

I can try to create a PR for this

@pascalkuthe
Copy link
Member

Yeah hashes to detect false positives would probably be good. IIRC vim does that too. Everywhere we update the timestamp we would update the hash too. (But only check hashes in case of a mismatched timestamp).

It does add quite a bit of extra IO to writing a file but it's probably OK. I would use blake3 for now we want to use a non-crpto hash for this in the future (that is still in development)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants