"Not in a git repo" returns
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- git, lua, neovim
- Domain
- developer-experience, tooling
Research direction
Start in lua/fff/main.lua at find_in_git_root(), then inspect the initialization and scan behavior behind get_git_root(). Reproduce the command in a valid Git repository on Windows, and verify that startup scanning or the git-root fallback prevents the warning and opens the repository root.
Written by the indexing model from the issue text.
Description
fff.nvim find_in_git_root regression
Error
- In a valid Git repository on Windows, running
find_in_git_root()shows:Not in a git repository
Cause
find_in_git_root()readsfuzzy.get_git_root()immediately.get_git_root()depends on async initial scan state.- On startup, scan state can still be empty, so
git_rootisnileven in a repo.
Successful mitigation
- Wait for initial scan before reading git root.
- If scan is not ready or
git_rootis empty, fall back to:git rev-parse --show-toplevelin currentcwd.
- This mitigation works in local testing.
Changed code
File: lua/fff/main.lua
function M.find_in_git_root()
local fuzzy = require('fff.core').ensure_initialized()
local wait_ok, scan_ready = pcall(fuzzy.wait_for_initial_scan, 5000)
if not wait_ok then
vim.notify('Failed to wait for initial scan', vim.log.levels.WARN)
end
local ok, git_root = pcall(fuzzy.get_git_root)
if not scan_ready or not ok or not git_root or git_root == '' then
local cwd = vim.fn.getcwd()
local result = vim.system({ 'git', 'rev-parse', '--show-toplevel' }, { cwd = cwd, text = true }):wait()
if result.code == 0 and result.stdout and result.stdout ~= '' then
git_root = result.stdout:gsub('%s+$', '')
end
end
if not git_root or git_root == '' then
vim.notify('Not in a git repository', vim.log.levels.WARN)
return
end
M.find_files_in_dir(git_root)
end
- Dominant language
- Rust
- Stars
- 11.2k
- Forks
- 473
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 32
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dmtrKovalenko/fff
-
triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dmtrKovalenko/fff#842 · 2 comments ·
Maintainers usually reply within 3 days
-
[Bug]: OSX/xcode 27 dyld wants 8-byte aligned string pools - mis-aligned LINKEDIT string poolPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
dmtrKovalenko/fff#978 ·
Maintainers usually reply within 3 days
-
[Bug]: pi-fff blocks session startup while indexing filesPossibly taken @adonis0147 claimed this 1 day ago. Openduplicate triaged
Difficulty 3/5 1-2 days Newbie friendliness 70/100
dmtrKovalenko/fff#975 · 1 comment ·
Maintainers usually reply within 3 days
-
[Bug]: on a non-git base path, the watcher indexes new files in hidden folders that the scan skips (0.11.0)Possibly taken @gustav-fff claimed this 3 days ago. Opentriaged
Difficulty 3/5 1-2 days Newbie friendliness 35/100
dmtrKovalenko/fff#972 · 1 comment ·
Maintainers usually reply within 3 days
-
triaged
Difficulty 4/5 3-5 days Newbie friendliness 45/100
dmtrKovalenko/fff#970 · 5 comments ·
Maintainers usually reply within 3 days
All issues in dmtrKovalenko/fff
Similar issues
-
ai_p2 bug comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ClickHouse/ClickHouse#128306 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area: ui enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
JavenKazebee/capture-room#166 ·
Maintainers usually reply within 1 day