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 support for git submodules #305

Closed
Antoine-dh opened this issue Dec 7, 2023 · 3 comments · Fixed by #306
Closed

Add support for git submodules #305

Antoine-dh opened this issue Dec 7, 2023 · 3 comments · Fixed by #306
Labels
bug Something isn't working customer Based on customer feedback (as opposed to something identified by developers)

Comments

@Antoine-dh
Copy link
Contributor

I use modules for different namespaces in my project setup as git submodules
Consider the following directory tree:

├── .git/ //main git directory
├── .gitmodules
└── modules/
    ├── ModuleA/
    │   ├── .git //git submodule A
    │   └── module.xml
    └── ModuleB/
        ├── .git //git submodule B
        └── module.xml

The problem I suppose is that sources are not correctly mapped because the package manager is looking for a directory named ".git" at the root of the module folder, however submodules are just simple files linking to the parent git directory

according to this line:
https://github.com/intersystems/git-source-control/blob/9aa8009111a14328118e0dcfef02cd7b3101a1e6/cls/SourceControl/Git/PackageManagerContext.cls#L27C1-L27C166

exemple .git file in a submodule:

$ cat modules/ModuleA/.git 
gitdir: ../../.git/modules/modules/ModuleA
@isc-tleavitt isc-tleavitt added bug Something isn't working customer Based on customer feedback (as opposed to something identified by developers) labels Dec 7, 2023
@isc-tleavitt isc-tleavitt added this to the Q1 2024 Polishing milestone Dec 7, 2023
@isc-tleavitt
Copy link
Collaborator

This is a good find - thanks for reporting!

@Antoine-dh
Copy link
Contributor Author

Antoine-dh commented Dec 14, 2023

Naively changing ##class(%Library.File).DirectoryExists() into ##class(%Library.File).Exists() at this line seems to fix the issue, and works for my use cases. More testing may be needed though

https://github.com/intersystems/git-source-control/blob/9aa8009111a14328118e0dcfef02cd7b3101a1e6/cls/SourceControl/Git/PackageManagerContext.cls#L27C1-L27C166

@isc-tleavitt
Copy link
Collaborator

Thanks - I have someone working on the milestone this is in starting Monday. I think you're just right though; feel free to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer Based on customer feedback (as opposed to something identified by developers)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants