By some command or variable,
could I { reset , force-set , check } Git dir that fugitive script manages?
Accidentally, sometimes it misunderstands Git root dir.
No specific way to reproduce, but, for example, likely to happen in the cases below:
In a parent repo A as the working dir, open a file in a submodule repo B.
It may get wrong b:git_dir as the repo A,
while it should be the repo B the file actually belongs to.
Manage a repo that is in a symbolic link dir,
and the repo setting is mixed with the symbolic-link path and the actual path.
Worked in a symbolic link dir /c/.../symlink/ to the actual dir /d/.../actual.
In a parent repo A, git clone-ed a repo B and git submodule add-ed to the repo A.
Then, git submodule absorbgitdirs-ed to move the .git dir of the submodule repo B
into the .git dir of the parent repo A.
Then, I got the .git file of repo B gitdir: ../.../../d/.../actual/repoA/.git/modules/repoB;
and the config setting of repo B core.worktree as ../.../../c/.../symlink/repoA/repoB or such.
The both points to the different path in the literal sense, fugitive works bad.
Gdiff does not work to show the target file itself instead of the file of the head commit,
as it gets different git root dir and file path
In fugitive#Path(url, ...),
the tree path and the file path url are obtained in literally-different paths each other.
Once it goes wrong, perhaps it memorize the status somewhere,
it hard to correct the wrong Git root dir path except restarting Vim.
To cover up such cases, can I manage the Git root dir manually?
By some command or variable, could I { reset , force-set , check } Git dir that fugitive script manages?
Accidentally, sometimes it misunderstands Git root dir.
No specific way to reproduce, but, for example, likely to happen in the cases below:
b:git_dir
as the repo A, while it should be the repo B the file actually belongs to./c/.../symlink/
to the actual dir/d/.../actual
.git clone
-ed a repo B andgit submodule add
-ed to the repo A. Then,git submodule absorbgitdirs
-ed to move the.git
dir of the submodule repo B into the.git
dir of the parent repo A..git
file of repo Bgitdir: ../.../../d/.../actual/repoA/.git/modules/repoB
; and the config setting of repo Bcore.worktree
as../.../../c/.../symlink/repoA/repoB
or such.Gdiff
does not work to show the target file itself instead of the file of the head commit, as it gets different git root dir and file pathfugitive#Path(url, ...)
, thetree
path and the file pathurl
are obtained in literally-different paths each other.Once it goes wrong, perhaps it memorize the status somewhere, it hard to correct the wrong Git root dir path except restarting Vim.
To cover up such cases, can I manage the Git root dir manually?