Closed lnc3l0t closed 6 months ago
Hi @lnc3l0t ,
Seems ruifm doesn't maintain this plugin any longer, please see my fork: https://github.com/linrongbin16/gitlinker.nvim.
I think I already support the bare repo
feature, see:
Please open any issue if it doesn't meet your requirements.
Usage:
By adding bare repository directories and their corresponding work_tree paths to
config.bare_repos
, users can now utilize the plugin with files tracked by those repositories. Multiple worktrees are not currently supported but can be implemented easily in the future.Changes Made:
Added a new option to the configuration,
bare_repos
, which is a list of pairs{git_dir, git_work_tree}
. If the plugin is used in a buffer associated with a bare repository, the first git command (git rev-parse) would fail, as the buffer is not in a regular git repo. To handle this, subsequent similar git commands are made with the--git-dir
and--work-tree
flags. When a buffer is identified as belonging to one of the bare repositories specified inconfig.bare_repos
, the information is cached for subsequent calls within the same session.Example:
A common use case is having a bare repository for managing dotfiles, that would be treated like so assuming the repo is in the
.dotfiles
folder and$HOME
is the worktree: