iterative/scmrepo

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

Closed this issue · 4 comments

efiop commented

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

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

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

efiop commented

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.

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