Disable shallow clones for all repos except those from github.com - #1393
Conversation
|
I think it would be better to Otherwise seems OK. |
|
I tried that at first but since GitHubResolver inherits GitRemoteResolver you get an error ( Can you think of another way to access methods in GitHubResolver from GitRemoteResolver? |
|
Or even better: create Then only check |
|
Sounds good. I'll try that. |
|
@sheerun Updated. |
|
Looks better :) @satazor Any doubts? |
|
👎 Everyone shouldn't be punished just because GitHub Enterprise is broken. |
|
@sindresorhus This is 1.3.x fix. We can introduce more granular control in 1.4.x. |
|
Btw. by introducing shallow clones bower punished every server not supporting it. |
|
I tend to agree with @sindresorhus's sentiments, but shallow clone will just not work for any host using dumb http transport. It'd be nice to get a clear picture / plan together for how we're going to address this as a whole, before this PR lands. |
…ithub Disable shallow clones for all repos except those from github.com
|
Thanks guys! |
|
Is there going to be a real fix for this at one point? We're using a private repo (not GitHub) that supports shallow clones, and our build time has increased significantly since this change. As part of our build/continuous integration process, we're cloning several projects into a local directory, and then run Is there an easy way to disable this change per repo? I would like to get our build fast and lean again. |
|
@nwinkler Could you create new issue? Maybe we'll introduce new configuration in next minor like: or |
|
Thanks - that makes sense - I've created #1558 for this. |
|
I've created PR #1559 to provide a config option per host for this in |
This PR disables shallow clones for all repos except those with github.com in the hostname. It does this by checking the hostname using a regex in the getOrgRepoPair method before setting the "--depth 1" flag.
This is an update to the PR #1389 (Add --full-depth flag to 'bower install'). @sheerun mentioned we should disable all shallow clones instead of creating a new flag.
Note: The getOrgRepoPair method was moved from the GitHubResolver to the GitRemoteResolver so that it could be accessed by the GitRemoteResolver. Any module that called getOrgRepoPair was refactored to reflect the move.