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

Do not use --depth=1 if the server does not support it, fixes #744 #747

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@satazor
Copy link
Member

satazor commented Aug 8, 2013

If a clone with --depth=1 fails, we retry without it.

Also, there are some git servers that do not support trailing .git, like RhodeCode.
Trailing .git was removed from the GitRemoteResolver and added to the GitHub resolver.
The point of having a trailing git was to normalise the sources and cache entries.

Test cases added and adjusted.

@@ -28,8 +37,7 @@ mout.object.mixIn(GitRemoteResolver, GitResolver);

// -----------------

GitRemoteResolver.prototype._checkout = function () {
var branch;
GitRemoteResolver.prototype._checkout = function (retry) {

This comment has been minimized.

@tschaub

tschaub Aug 8, 2013

Contributor

Unused arg?

@tschaub

This comment has been minimized.

Copy link
Contributor

tschaub commented Aug 8, 2013

Fixes the issue for me @satazor.

@satazor

This comment has been minimized.

Copy link
Member

satazor commented Aug 9, 2013

@tschaub good catch, remove the unused retry variable.

satazor added some commits Aug 10, 2013

Do not add trailing .git for every source and protocol.
There are some git servers that do not support trailing .git, like RhodeCode.
Trailing .git was removed from the GitRemoteResolver and added to the GitHub resolver.
The point of having a trailing git was to normalise the sources and cache entries.

Test cases added and adjusted.

@satazor satazor closed this in ee2640b Aug 10, 2013

@satazor satazor deleted the shallow-fallback branch Aug 10, 2013

@tschaub

This comment has been minimized.

Copy link
Contributor

tschaub commented Aug 20, 2013

I realize now that the "fixes it for me" comment was likely because the clone was already in Bower's cache after succeeding once with 3a6a179.

@fsferrara

This comment has been minimized.

Copy link

fsferrara commented on 2023c9c Jul 11, 2014

Hello @satazor .
I have still problem with repositories that does not support the option '--depth'.
I'm using artifactory for storing the git repository and the uri is like this: http://artifactory.company.com/collection/my-module.git.
I think the problem here is that I'm using 'http tranport' that does not support this feature. Here the log:

Cloning into '.'...
fatal: dumb http transport does not support --depth

Unfortunaltely grunt-bower-task module try to use the option '--depth' even if the repository is using the http transport.

Can you help me?

This comment has been minimized.

Copy link
Member

satazor replied Jul 11, 2014

@fsferrara We have improved the no --depth fail detection, see: https://github.com/bower/bower/blob/master/lib/core/resolvers/GitRemoteResolver.js#L136

Cloning into '.'... fatal: dumb http transport does not support --depth contains --depth in the error message so bower should be catching and fallback to the slow clone which does not use --depth. What version of bower are you using?

This comment has been minimized.

Copy link

fsferrara replied Jul 14, 2014

Hello @satazor,

You're right! I don't have the patch https://github.com/bower/bower/blob/master/lib/core/resolvers/GitRemoteResolver.js#L136 in my bower version.
I'm going to upgrade it ;)

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment