r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
336 stars 153 forks source link

When requesting HEAD, dont use --branch #612

Closed bbimber closed 3 years ago

bbimber commented 3 years ago

@jimhester - this is related to #580, but I missed it before.

When the bioc development branch is specified, remotes will use 'HEAD' as the branch. This results in something like:

Downloading Bioconductor repo https://git.bioconductor.org/packages/SingleR
'/usr/bin/git' clone --depth 1 --no-hardlinks --branch HEAD https://git.bioconductor.org/packages/SingleR /tmp/Rtmpnl7qak/file945***70f4705f
Cloning into '/tmp/Rtmpnl7qak/file945***70f4705f'...
warning: Could not find remote branch HEAD to clone.

I think the right solution is to not include "--branch" in the git command if the requested branch is HEAD. I believe this has been a long-standing issue, that could not easily have been hit before.

bbimber commented 3 years ago

@jimhester hello - sorry to bug but I wanted to check back on this PR. Again, I think this bug would have been hard to encounter before; however, if one tries to checkout bioconductor packages where release = 'Dev' it will be hit. The problem (unless I'm missing something in git), is that 'HEAD' isnt a valid value for '--branch'. This PR checks for 'HEAD' and prevents adding '--branch=HEAD'. If there's another solution to this I'm happy to adjust. Thanks in advance.

bbimber commented 3 years ago

@jimhester hey - thought i'd check back on this. i've been using this branch on github actions for a couple months and this fix does work. is there a chance you'd be willing to accept the PR?

jimhester commented 3 years ago

Can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

bbimber commented 3 years ago

@jimhester done

bbimber commented 3 years ago

@jimhester just following up: anything else you need me to do here?

bbimber commented 3 years ago

@jimhester good morning - just thought i'd check back again. is there anything else you need?

jimhester commented 3 years ago

Thanks a bunch!

bbimber commented 3 years ago

@jimhester great - thanks!