Skip to content

Report git-subrepo's command info from non-standard installations #606

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acr4
Copy link

@acr4 acr4 commented Dec 20, 2023

When git-subrepo is invoked from a Git worktree or Git submodule, .git is a file, not a directory. As such it is necessary to traverse to the actual .git/ directory which is located elsewhere.

This patch teaches git-subrepo to use git -C $lib instead of GIT_DIR=$lib/.git git. Doing so places the burden on the Git executable to locate the canonical path of the install's .git/ directory.

While GIT_DIR has been around since Git v0.99, the -C option was "only" added in v1.8.5. Nevertheless, this does not impair git-subrepo as it already requires Git >= v2.7 due to its reliance on worktrees.

When git-subrepo is invoked from a Git worktree or Git submodule, .git is a
file, not a directory. As such it is necessary to traverse to the actual .git/
directory which is located elsewhere.

This patch teaches git-subrepo to use `git -C $lib` instead of
`GIT_DIR=$lib/.git git`. Doing so places the burden on the Git executable to
locate the canonical path of the install's .git/ directory.

While GIT_DIR has been around since Git v0.99, the `-C` option was "only" added
in v1.8.5. Nevertheless, this does not impair git-subrepo as it already requires
Git >= v2.7 due to its reliance on worktrees.
@admorgan admorgan self-requested a review July 7, 2024 22:17
@admorgan admorgan self-assigned this Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants