Skip to content
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

Add git submodule support (to detect submodule repos) #272

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

Conversation

varunsairam
Copy link

Found that git submodules were not getting detected by vcs. Believe the issue comes down to file structure and type.

(Also faced in issue: #198)

Typical git repo

git_repo
    |--- .git (directory)

Submodule repo

outer_repo
    |--- .git (directory)
    |--- submodule_repo
         |--- .git (file)

Contents of .git file (the one inside the submodule_repo):

gitdir: ../.git/modules/submodule_repo

So effectively, submodules don't have .git directory of their own but rather a .git linked file that links to the directory in the outer .git directory.

Currently, it appears that vcstool is designed to determine if a repo is a git repo by checking for only a .git directory:

return os.path.isdir(os.path.join(path, '.git'))

Tried to fix this here. The submodules now seem to get detected as git repos. Hope there would be no unintended consequences though?

@varunsairam varunsairam changed the title Add git submodule suppot (to detect submodule repos) Add git submodule support (to detect submodule repos) Apr 7, 2024
@rty813
Copy link

rty813 commented Aug 1, 2024

really need this feature!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants