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

feat: support for detached working trees #600

Merged
merged 1 commit into from Aug 10, 2022
Merged

Conversation

lewis6991
Copy link
Owner

@lewis6991 lewis6991 commented Aug 9, 2022

Added config.worktrees.

Array of tables with the keys 'gitdir' and 'toplevel'.

If attaching normally fails, then each entry in the table is attempted.

Example:

  worktrees = {
    {
      toplevel = vim.env.HOME,
      gitdir = vim.env.HOME .. '/projects/dotfiles/.git'
    }
  }

Resolves #397

@lewis6991 lewis6991 force-pushed the detached_worktrees branch 4 times, most recently from d6e3240 to 9b09c55 Compare August 10, 2022 09:08
Added config.worktrees.

Array of tables with the keys 'gitdir' and 'toplevel'.

If attaching normally fails, then each entry in the table is attempted.

Example:

  worktrees = {
    {
      toplevel = vim.env.HOME,
      gitdir = vim.env.HOME .. '/projects/dotfiles/.git'
    }
  }

Resolves #397
@marwing
Copy link

marwing commented Aug 10, 2022

This seems to work now. In a normal git repo as well as with something from my dotfiles signs show up correctly and I can stage changes.

@lewis6991 lewis6991 merged commit 50e32c6 into main Aug 10, 2022
@lewis6991 lewis6991 deleted the detached_worktrees branch August 10, 2022 10:15
@marwing
Copy link

marwing commented Aug 10, 2022

Great! Thanks for working on this. This is a very much appreciated feature by probably everyone using a bare repo for dotfiles or other purposes. (And miles better than GIT_DIR=$HOME/.dotfiles GIT_WORK_TREE=$HOME nvim)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for detached work trees
2 participants