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

Repository scoped configuration #446

Open
smackesey opened this issue Jan 15, 2022 · 1 comment
Open

Repository scoped configuration #446

smackesey opened this issue Jan 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@smackesey
Copy link

smackesey commented Jan 15, 2022

When working on multiple projects within the same Vim instance, gitsigns "base"-configuration functionality is not ideal, because there is no (documented) way to set the base separately for different projects. For example, suppose I am working on feature branches on project1 and project2. project1 uses main and project2 uses master for the central branch. I want to check the status of my feature branch against main in project1, so I run require('gitsigns').reset_base('main', true).

This is great for project1, but now the entire file content in project2 is treated as new, because the nonexistent branch main has been set as the base for project2.

Describe the solution you'd like
Allow setting cwd (i.e. project/workspace)-scoped base:

require('gitsigns').change_base('main', 'cwd')  # update for project
require('gitsigns').change_base('main, 'global')  # update globally

You could preserve backward compatibility by treating any truthy value that is not 'cwd' as equivalent to 'global'.

Describe alternatives you've considered
A hack where I store the cwd-scoped base in an external data structure and use autocmds to set the buffer base from this structure. Undesirable.

@smackesey smackesey added the enhancement New feature or request label Jan 15, 2022
@lewis6991
Copy link
Owner

I think instead of cwd scoped, we want repo scoped, but either way this would be a useful feature that I find myself wanting too.

@lewis6991 lewis6991 changed the title Set cwd-scoped base Repository scoped configuration Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants