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

GitSigns doesn't consider tracked files from a bare repository if the file is inside the git repository folder #923

Closed
adamency opened this issue Dec 8, 2023 · 2 comments · Fixed by #968 · May be fixed by #1011
Closed
Labels
bug Something isn't working

Comments

@adamency
Copy link

adamency commented Dec 8, 2023

Description

In the context of configuration files version control, I have a bare git repository at the root of my filesystem, e.g. at /.mysystemrepo.

I have some files which are helpers for the usage of the repository and are not needed by the system to work, but I still want them checked out in my repository. So for to understand the purpose, they can only be placed within the git repository itself in a folder named meta, i.e. in /.mysystemrepo/meta.

Now, GitSigns never print any signs on such files, it seems to not consider them as valid trackable files.

However this is perfectly possible with git itself and other cli tools like tig as long as we provide them with the correct GIT_WORKTREE and GIT_DIR.

I have tried all methods I could find:

require('gitsigns').setup {
    worktrees = {
      {
        toplevel = '/',
        gitdir = '/.mysystemrepo'
      },
}
vim.env.GIT_DIR = "/.mysystemrepo/"
vim.env.GIT_WORK_TREE = "/"
  1. simply running
GIT_DIR="/.mysystemrepo" GIT_WORK_TREE="/" vim

All three methods make GitSigns work correctly for files everywhere else, but not for any tracked files inside /.mysystemrepo , when again tig will correctly show me the diff in its TUI.

Is there somewhere in code where we disable looking at files in the git repository folder ?

Neovim version

0.9.4

Operating system and version

linux rolling

Minimal config

nothing except gitsigns installed and code provided in description

@adamency adamency added the bug Something isn't working label Dec 8, 2023
lewis6991 added a commit that referenced this issue Apr 3, 2024
Only if GIT_DIR and GIT_WORK_TREE exist in the env

Fixes #923
@lewis6991
Copy link
Owner

Can you test #968

lewis6991 added a commit that referenced this issue Apr 3, 2024
Only if GIT_DIR and GIT_WORK_TREE exist in the env

Fixes #923
@adamency
Copy link
Author

adamency commented Apr 5, 2024

@lewis6991 Thanks ! This is not the best time currently but I will test it as soon as I can !

lewis6991 added a commit that referenced this issue May 1, 2024
Only if GIT_DIR and GIT_WORK_TREE exist in the env

Fixes #923
lewis6991 added a commit that referenced this issue May 1, 2024
lewis6991 added a commit that referenced this issue May 1, 2024
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
2 participants