Skip to content

Changing b:git_dir to use custom --git-dir name before running :Agit #62

@mwgkgk

Description

@mwgkgk

What I'm trying to achieve is, having two separate git histories for the same work tree, one with properly named commits and another for auto-committing work-in-progress every now and then. I achieved this behavior with --git-dir, but now I want to be able to run :Agit for each of the trees.

This is what I do (this should only work when fugitive is on):

nnoremap <F11> :let b:git_dir = substitute(b:git_dir, ".git$", ".wip", "")<CR>:Agit<CR>

The git.git_dir property does get initialized properly, but all three default views have the message

fatal: The empty string is not a valid path

which probably means some calls to git don't respect the git_dir parameter. There are such calls in the code but I couldn't find the relevant ones. I'll be working on understanding the codebase, just reporting here to ask for help. This issue might be related to #48 or #19

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions