Skip to content

Using create submodule doesn't create the correct submodule structure #1867

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

Closed
aliencrash opened this issue Mar 12, 2024 · 4 comments
Closed

Comments

@aliencrash
Copy link

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?

@Byron
Copy link
Member

Byron commented Mar 12, 2024

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.

@Byron
Copy link
Member

Byron commented Mar 12, 2024

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.

@Byron Byron closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@aliencrash
Copy link
Author

Ok Thank you.

@EliahKagan
Copy link
Member

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.

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

No branches or pull requests

3 participants