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

Use --depth=1 when checking out git repositories #2439

Closed
wants to merge 1 commit into from

Conversation

anguslees
Copy link

@anguslees anguslees commented Feb 24, 2015

In most uses of pip's git backend, we don't need the full git history -
only the target head/branch/tag. This change adds --depth=1 to git
fetch and clone commands.

Fixes #2432

Review on Reviewable

@anguslees
Copy link
Author

Only "lightly tested" so far. A basic install from git (with and without tag) works, but I haven't tested the various combinations of update() and switch().

NB: (As written) this no longer supports checking out from an arbitrary commit - it needs to be branch name or tag. If this feature is considered critical, then fixing it probably involves recognising the situation and falling back to the previous (full checkout) behaviour :(

@msabramo
Copy link
Contributor

msabramo commented Mar 5, 2015

pip installing from an arbitrary commit is very useful

@msabramo
Copy link
Contributor

msabramo commented Mar 5, 2015

is that why Travis CI failed?

In most uses of pip's git backend, we don't need the full git history -
only the target head/branch/tag.  This change adds --depth=1 to git
fetch and clone commands.

NB: "Shallow" checkouts are not supported from arbitrary git commits, so
this change removes the ability to install from git SHA1 commit IDs.
Tags and branches continue to be supported.

Fixes pypa#2432
@blueyed
Copy link
Contributor

blueyed commented Jun 17, 2015

pip installing from an arbitrary commit is very useful

Yes, that should not be removed.

@anguslees
Do you see a way to keep this functionality?

It could just use not --depth 1 for this.

See also NixOS's prefetch-git: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/fetchgit/nix-prefetch-git.

@RonnyPfannschmidt
Copy link
Contributor

How does this fare against repos that use setuptools-scm

@blueyed
Copy link
Contributor

blueyed commented Jan 22, 2016

Could setuptools-scm use git fetch --unshallow automatically in that case?

@RonnyPfannschmidt
Copy link
Contributor

its tricky to do and error prone, so #d like to avoid it,

@dstufft dstufft closed this May 18, 2016
@dstufft
Copy link
Member

dstufft commented May 18, 2016

Accidentally closed this, reopening. Sorry!

@dstufft dstufft reopened this May 18, 2016
@BrownTruck
Copy link
Contributor

Hello!

As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the master branch. However, this Pull Request was made against the develop branch so it will need to be resubmitted against master. Unfortunately, this pull request does not cleanly merge against the current master branch.

If you do nothing, this Pull Request will be automatically closed by @BrownTruck since it cannot be merged.

If this pull request is still valid, please rebase it against master (or merge master into it) and resubmit it against the master branch, closing and referencing the original Pull Request.

If you choose to rebase/merge and resubmit this Pull Request, here is an example message that you can copy and paste:

In most uses of pip's git backend, we don't need the full git history -
only the target head/branch/tag.  This change adds --depth=1 to git
fetch and clone commands.

Fixes #2432

---

*This was migrated from pypa/pip#2439 to reparent it to the ``master`` branch. Please see original pull request for any previous discussion.*

@BrownTruck
Copy link
Contributor

This Pull Request was closed because it cannot be automatically reparented to the master branch and it appears to have bit rotted.

Please feel free to re-open it or re-submit it if it is still valid and you have rebased it onto master or merged master into it.

@BrownTruck BrownTruck added auto-bitrotten PRs that died because they weren't updated and removed asked to reparent labels May 26, 2016
@BrownTruck BrownTruck closed this May 26, 2016
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-bitrotten PRs that died because they weren't updated auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants