snacks.nvim/lua
Daniel Danner e441c641eb
perf(git): invoke git status with --no-optional-locks (#2175)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
According to the Git docs, `git status` automatically refreshes the
index, meaning it recreates the `.git/index` file. In `watch.lua`, we
specifically watch for modifications of that file and (indirectly?) run
`git status` everytime it changes. This effectively forms an infinite
loop of refreshes whenever the explorer is open.

Passing `--no-optional-locks` to `git status` breaks this loop because
it stops it from refreshing the index. Doing this also happens to be the
official recommendation for scripts doing `git status` in the
background: https://git-scm.com/docs/git-status#_background_refresh

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-10-19 08:41:34 +02:00
..
snacks perf(git): invoke git status with --no-optional-locks (#2175) 2025-10-19 08:41:34 +02:00
trouble/sources Revert "feat: test" 2025-02-14 22:13:38 +01:00