Skip to contentSkip to conversation

Gitsm and abosulte paths in .gitmodules file

DISCUSSION [email protected] 1 participant 1 message Jul 31, 2024

lore
Share & tools
lore
#0 lore raw

Hello,
I am having an issue with the way gitsm handles aboslute paths from .gitmodules file if ssh protocol is used.
When I add new module to some repo (as an example, I will use azure devops here), normally I take the address by cloning it from repo site; example:

```
[email protected]:v3/TZ/proj/repo.git
```
Then add it to other repo with command
```
git submodule add [email protected]:v3/TZ/proj/repo.git path/repo-ext
```
which creates following entry in .gitmodules
```
[submodule "path/repo-ext"]
path = path/repo-ext
url = [email protected]:v3/TZ/proj/repo.git
```
When bitbake try to fetch it, it will put a warning about `relative ssh
reference`
```
myrecipe-0.1.0-r0 do_unpack: Submodule included by
gitsm://ssh.dev.azure.com/v3/TZ/proj/myrecipe;branch=main;rev=xxxx;protocol=ssh
refers to relative ssh reference [email protected]:v3/TZ/proj/repo.git.
References may fail if not absolute.
```

IIUC the reference is absolute here. After looking at gitsm.py
https://git.openembedded.org/bitbake/tree/lib/bb/fetch2/gitsm.py#n107 I saw it is looking for :/. Is that correct? Why there is distinction between : and :/?
Or maybe it is a common practice to add submodules with :/ instead of :? I would gladly contribute, but maybe I do not understand the problem here. Can I ask for some guidance?