You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is a great suggestion. Should this be available with an option to enable/disable it? I would enable this by default, where you can disable it with { detectSubmodule: false } (default is set to true). However, this would mean a breaking change in my eyes.
That is a great suggestion. Should this be available with an option to enable/disable it? I would enable this by default, where you can disable it with { detectSubmodule: false } (default is set to true). However, this would mean a breaking change in my eyes.
Not sure where that option should live, but its usecase depends on what's implemented. According to the documentation we have the following:
--git-dir
Show $GIT_DIR if defined. Otherwise show the path to the .git directory. The path shown, when relative, is relative to the current working directory.
If $GIT_DIR is not defined and the current directory is not detected to lie in a Git repository or work tree print a message to stderr and exit with nonzero status.
...
--show-toplevel
Show the (by default, absolute) path of the top-level directory of the working tree. If there is no working tree, report an error.
...
--absolute-git-dir
Like --git-dir, but its output is always the canonicalized absolute path.
So I believe if we are in a submodule structure we are always good with the --absolute-git-dir else the top level is more than enough.
To check if the current directory is a submodule, you could use git rev-parse --show-superproject-working-tree and if there is any output then you are part of a submodule. Like this there wont be any breaking change I think
Activity
JPeer264 commentedon Jan 17, 2023
That is a great suggestion. Should this be available with an option to enable/disable it? I would enable this by default, where you can disable it with
{ detectSubmodule: false }(default is set totrue). However, this would mean a breaking change in my eyes.dbranco-sdc commentedon Jan 17, 2023
Hello
Not sure where that option should live, but its usecase depends on what's implemented. According to the documentation we have the following:
So I believe if we are in a submodule structure we are always good with the --absolute-git-dir else the top level is more than enough.
To check if the current directory is a submodule, you could use
git rev-parse --show-superproject-working-treeand if there is any output then you are part of a submodule. Like this there wont be any breaking change I think