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

clone: use gitpython's CLI git first and fallback to dulwich if CLI git is not available #208

Closed
efiop opened this issue Mar 15, 2023 · 4 comments · Fixed by #213
Closed
Assignees

Comments

@efiop
Copy link
Contributor

efiop commented Mar 15, 2023

With all of the auth problems and stuff like iterative/dvc-ssh#20 , we are probably better off just using cli git for clone first and fallback to dulwich if not available.

clone used to be the last gitpython thing for a very long time without any problems and the whole point of migrating clone to dulwich was so that dvc get/import/list could work in environments without git cli (e.g. during deployment in docker images), but we could get both benefits by just falling back to dulwich.

CC @dberenbaum

@dberenbaum
Copy link
Contributor

This would help with avoiding auth issues like iterative/dvc-ssh#20 which I don't know if we will ever be able to solve without git cli

@skshetry
Copy link
Member

Note that these problems are not limited to clone, fetch/pull are similarly affected and needs to be changed.

@efiop
Copy link
Contributor Author

efiop commented Mar 16, 2023

Though I guess this is not really a scmrepo issue. Users (dvc) can just pass backends arg to the function they are calling. The only thing we need to do here is catch gitpython's GitCommandNotFound in _backend_func and in clone. Will send a PR

EDIT: though for best user experience we can probably prefer gitpython after all.

efiop added a commit that referenced this issue Mar 17, 2023
clone/push/pull/fetch/push_refspecs/fetch_refspecs all rely on auth heavily
and git CLI, unfortunately, handles it the best across the board.

Note that push/fetch_refspecs are not implemented in gitpython backend yet,
so this won't work for them until those are implemented.

Fixes #208
@dberenbaum
Copy link
Contributor

Beyond clone/auth operations, there are also some other inconsistencies with Git CLI like #211.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
4 participants