Skip to content

Can't pass multiple config values to clone or clone_from #824

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

Open
ninloot opened this issue Jan 14, 2019 · 4 comments
Open

Can't pass multiple config values to clone or clone_from #824

ninloot opened this issue Jan 14, 2019 · 4 comments

Comments

@ninloot
Copy link
Contributor

ninloot commented Jan 14, 2019

The clone command in git supports a --config parameter that can be repeated several times on the command line to set multiple config parameters. There is no why to call clone or clone_from with multiple config parameters. What I would like to do is:
Repo.clone_from(url, dir, config='submodule.repo1.update=none', config='submodule.repo2.update=checkout')
This can't be done because there are multiple keywords repeatedly passed to clone. You can't construct a dictionary for the same reason. One solution would be to allow for any string to be passed to to the underlying git process.

@Byron
Copy link
Member

Byron commented Jan 20, 2019

Indeed the current API doesn't allow to do that or even to workaround this issue.
There is no easy workaround, as it would entail using the Git command-wrapper directly and possibly repeating some logic. The latter is able to receive *args, so you can do things like this: git.clone(..., '--config=foo', '--config=bar', ...).

@ninloot
Copy link
Contributor Author

ninloot commented Jan 30, 2019

I'm fairly new to Python programming but I've implemented a fix so that one can pass config values to the clone and clone_from methods. I have some cleanup to do and need to do more testing but I think it works.

@ninloot
Copy link
Contributor Author

ninloot commented Feb 4, 2019

I've created a PR #836 to address this issue.

@Byron Byron added this to the v2.1.12 - Bugfixes milestone Jul 6, 2019
@Byron
Copy link
Member

Byron commented Jul 6, 2019

Closed via #836.

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

No branches or pull requests

2 participants