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

[fix] remove extra / from ref when path has "/" prefix #167

Merged
merged 2 commits into from
May 12, 2019

Conversation

sakihet
Copy link
Contributor

@sakihet sakihet commented May 10, 2019

ghq fails to clone some repo like "git@example.com:/foo/bar.git".

@Songmu
Copy link
Member

Songmu commented May 10, 2019

In this case, you may use the following command.

% ghq get git@example.com:foo/bar.git

I think git@example.com:foo/bar.git and git@example.com:/foo/bar.git is different URL.

The former is the path from the user's home directory (e.g. /home/git/foo/bar), and the latter is the path from the system root (/foo/bar). This SCP-like URL format is not standardized, but at least SCP behaves like that and the Git is also.

So I think there is no need to fix it, how about that?

@sakihet
Copy link
Contributor Author

sakihet commented May 10, 2019

@Songmu
https://backlog.com 's git repo url format is ***@***.git.backlog.jp:/PROJECT_KEY/repo.git.
ghq 0.10.2 can clone this repo but ghq 0.11.0(or later) can't clone this.
that is why i tried to fix.

ghq is really useful tool and i'd like to use it for backlog git repo if possible.

@Songmu
Copy link
Member

Songmu commented May 12, 2019

I'm sorry. I misunderstood the spec of Git's SCP-like URL and SSH URL.
If the Git repository URL has an SSH scheme, that path can be considered as an absolute system path.

So, your implementation is correct.

@Songmu Songmu merged commit 29b0e41 into x-motemen:master May 12, 2019
@Songmu Songmu changed the title remove extra / from ref when path has "/" prefix [fix] remove extra / from ref when path has "/" prefix May 12, 2019
Songmu added a commit that referenced this pull request May 12, 2019
## [v0.12.2](v0.12.1...v0.12.2) (2019-05-12)

* [fix] remove extra / from ref when path has "/" prefix [#167](#167) ([sakihet](https://github.com/sakihet))
* [fix] refine local cloning path detection [#171](#171) ([Songmu](https://github.com/Songmu))
* [fix] skip go-import mod in detectGoImport [#170](#170) ([Songmu](https://github.com/Songmu))
* [fix] even if the GHQ_ROOT directory doesn't exist, don't raise an error [#168](#168) ([Songmu](https://github.com/Songmu))
@Songmu
Copy link
Member

Songmu commented May 12, 2019

It is released as v0.12.2. Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants