Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

GitDownloadStrategy optimization #11976

Closed
wants to merge 1 commit into from
Closed

GitDownloadStrategy optimization #11976

wants to merge 1 commit into from

Conversation

jacknagel
Copy link
Contributor

The current series of fetch invocations in GitDownloadStrategy has the unfortunate behavior of fetching full history even in shallow clones that only need the history between the clone point and the remote HEAD. It should be possible to determine if it is actually necessary to fetch the full history, including all tags, and if it is not to avoid this overhead.

This fixes #11958, and using :revision (previously :sha) should always clone with full depth; tags and branches are shallow cloned when possible.

I'd like to make host_supports_depth? smart enough to query the remote and determine if shallow clones are supported; right now we can only assume shallow clones are possible when using the git protocol or GitHub HTTP/S.

I tested 15-20 git checkouts, but please test any problematic formulae that you know of.

@2bits
Copy link
Contributor

2bits commented May 1, 2012

Edit: The problem I reported below has been solved in the issue listed.


I pulled this and tried it using brew install -vd --with-clang llvm, and it worked to clone both llvm--git and clang--git. So it appears to function well, and that is appreciated.

But the llvm formula must still be broken, because I get the same problem I brought up in #10893. I went ahead and made a gist of the terminal output so you could see it cloning and the error. I'll solve this over in that issue.

The current series of fetch invocations in GitDownloadStrategy has the
unfortunate behavior of fetching full history even in shallow clones
that only need the history between the clone point and the remote HEAD.
It should be possible to determine if it is actually necessary to fetch
the full history, including all tags, and if it is not to avoid this
overhead.

Fixes #11958, and several other recurring problems.

Signed-off-by: Jack Nagel <[email protected]>
@jacknagel
Copy link
Contributor Author

@adamv @MikeMcQuaid

As this is a bugfix, I'm going to merge it in a bit unless there are objections.

@adamv
Copy link
Contributor

adamv commented May 2, 2012

Be my guest.

@jacknagel
Copy link
Contributor Author

Pushed.

@jacknagel jacknagel closed this May 2, 2012
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git Flow Fails on 10.8
3 participants