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

install_git removes the "@" from the url #646

Closed
stla opened this issue Sep 2, 2021 · 3 comments
Closed

install_git removes the "@" from the url #646

stla opened this issue Sep 2, 2021 · 3 comments

Comments

@stla
Copy link

stla commented Sep 2, 2021

Hello,

I'm using Windows 10 and I'm trying to install a package from Azure DevOps.

> remotes::install_git("https://[email protected]/stephanexlaurent/MyProject/_git/MyPackage", git="external")
Error: Failed to install 'unknown package' from Git:
  Command failed (128)
In addition: Warning messages:
1: In system(full, intern = TRUE, ignore.stderr = quiet) :
  running command '"C:\PORTAB~1\cmder\vendor\GIT-FO~1\cmd\git.exe" ls-remote https://stephanexlaurent dev.azure.com/stephanexlaurent/MyProject/_git/MyPackage' had status 128

Observe the warning message in system: the "@" has been replaced with a white space.

@achimgaedke
Copy link
Contributor

achimgaedke commented Sep 20, 2021

Take the regexp from https://github.com/r-lib/remotes/blame/37f5c96f442a8b7696e024dd6badfa83048067fd/R/install-git.R#L82 and try it out:

meta <- rematch2::re_match("ssh://[email protected]:22/analytics/use-this.git",
                           "(?<url>(?:git@)?[^@]*)(?:@(?<ref>.*))?")

meta$url is 'ssh://git' and the rest without the leading @ is in meta$ref 😿

@vspinu
Copy link

vspinu commented Oct 15, 2021

Works with v2.3.0:

> url <- "ssh://[email protected]:7999/proj/name.git"
> remotes:::git_remote(url)
$url
[1] "ssh://[email protected]:7999/proj/name.git"

$subdir
NULL

$ref
NULL

$credentials
NULL

attr(,"class")
[1] "git2r_remote" "remote"      

Doesn't work in dev nor the released CRAN version v2.4.0:

> url <- "ssh://[email protected]:7999/proj/name.git"
> remotes:::git_remote(url)
$url
[1] "ssh://git"

$subdir
NULL

$ref
[1] "git.host.com:7999/proj/name.git"

$credentials
NULL

attr(,"class")
[1] "git2r_remote" "remote"      

Thus devtools::install_git on all git urls currently fails.

@ThomUK
Copy link

ThomUK commented Jun 15, 2022

This issue was fixed in #658, and should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants