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

Neogit no longer respects showUntrackedFiles #767

Closed
AThePeanut4 opened this issue Aug 19, 2023 · 1 comment · Fixed by #768
Closed

Neogit no longer respects showUntrackedFiles #767

AThePeanut4 opened this issue Aug 19, 2023 · 1 comment · Fixed by #768
Labels
bug Something isn't working

Comments

@AThePeanut4
Copy link
Contributor

AThePeanut4 commented Aug 19, 2023

Description

Since #722 (specifically f7811cc), Neogit no longer respects showUntrackedFiles in .git/config. Previously, untracked files were not shown if showUntrackedFiles = no, but now they are always shown, irrespective of what this is set to.

Context:

I use git to manage my dotfiles, with the bare repository in the ~/.dotfiles folder, and the worktree at ~. In order to be able to use git from the command-line, I have a shell alias that wraps the git command to add the --git-dir argument.

I also have Neovim set up to export the GIT_DIR environment variable when I am editing my config files, which allows plugins like diffview, gitsigns and Neogit to work correctly. For Neogit specifically, this works great - I am able to stage, commit, push, etc without issue.

However, because the worktree is at ~, I need to be able to ignore untracked files, since every non-configuration file in my home directory is, and should be, untracked. For the git CLI, setting showUntrackedFiles = no does the trick, and before f7811cc, this also worked in Neogit.

Additionally, untracked files are now listed in Neogit individually instead of as directories, which means that now tens of thousands of files are loaded and displayed as untracked, making the status buffer extraordinarily slow - both to load and to navigate.

I have tried to disable the "Untracked files" section using the sections = { untracked = { hidden = false } } config option, but this just hides the section from being displayed - the data is still being loaded. The status page still takes forever to load, where it was close to instant before.

I think either showUntrackedFiles should be respected, or hiding the section should actually stop the data from being loaded. I would prefer showUntrackedFiles, since it would make my neovim config simpler, but either will work. Perhaps even an analogous config option to showUntrackedFiles, where you can specify whether to show nothing (git's no), files and root directories (git's normal - git's default) or all files in all directories (git's all - Neogit's new default).

Neovim version

NVIM v0.10.0-dev-882+gd7ae9ae3e5
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

Arch Linux

Steps to reproduce

  1. Set status.showUntrackedFiles = no in a git repository (git config status.showUntrackedFiles no)
  2. Add untracked files
  3. Open the Neogit status buffer in that repository

Expected behavior

Untracked files should not be listed under "Untracked files".

Actual behavior

Untracked files are listed under "Untracked files".

Minimal config

-- N/A, no special config necessary
@CKolkey
Copy link
Member

CKolkey commented Aug 20, 2023

Thanks for the heads up - you're right, of course. Should be working now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants