gitpython-developers / GitPython

GitPython is a python library used to interact with Git repositories.

Home Page:http://gitpython.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using create submodule doesn't create the correct submodule structure

aliencrash opened this issue · comments

Hi,

I'm using GitPython to manage repository but I'm having some issues with submodule.
This is a snipped of my code.
image

What I'm trying to do is to create the sub-modules when they don't exist.
The method does everything right until I run the following code that is to add the folder with all submodules 'saas_env', create commit and push.
image

The result of push is
image

But then I'm not able to clone the repository.

It's something I'm doing wrong?

Thanks for reporting and showing (probably) all the relevant pieces of code that lead to the unexpected behaviour (even though I don't necessarily understand what that is).

However, as general advice: try to use repo.git.submodule(…git arguments…) instead, as the built-in submodule implementation is old and can't be trusted. When that is done, it might already work as create_submodule() probably also can't be trusted.

As submodules are known to be wonky, and GitPython is in maintenance mode, I am closing this issue as 'not planned', and thank you for your understanding.

However, if you discover anything that would allow improvements, the issue can be reopened if it would aid the creation of a PR.

Ok Thank you.

Although #1859 will not fix a bug like this, in working on it I've been looking at, and shall be looking more at, the code in git/objects/submodule/base.py. If you do end up finding more information that could point the way to a fix, then I might be able to do something with it, or help you (or another contributor) to do so.

So please feel free to @-mention me if you do find something, and I'll take a look. I emphasize though that I cannot promise anything and this is not a request for you to investigate this further, which I cannot predict would be worthwhile for you to do.