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

ghq does not work well with multiple ghq.root with nonexistent directory #165

Closed
znz opened this issue May 8, 2019 · 2 comments
Closed

Comments

@znz
Copy link

znz commented May 8, 2019

Recent ghq does not work with multiple ghq.root with nonexistent directory.

I use first ghq.root only. Second ghq.root for ghq list after I use go get.

I don't know which ghq version does not work.
At least, old ghq works well.

environment:
macOS Mojave and install ghq using homebrew

% sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.4
BuildVersion:	18E226
% brew info ghq
ghq: stable 0.12.1 (bottled)
Remote repository management made easy
https://github.com/motemen/ghq
/usr/local/Cellar/ghq/0.12.1 (7 files, 8.0MB) *
  Poured from bottle on 2019-05-08 at 21:37:47
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ghq.rb
==> Dependencies
Build: go ✘
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Analytics
install: 2,103 (30 days), 2,943 (90 days), 6,643 (365 days)
install_on_request: 1,940 (30 days), 2,771 (90 days), 6,406 (365 days)
build_error: 0 (30 days)
% git config --get-all ghq.root
/Users/kazu/s
/Users/kazu/g/src
% ghq --version
ghq version 0.12.1 (rev:)

expected:
ghq get https://github.com/motemen/ghq clone to ~/s/github.com/motemen/ghq.

actual:

% ghq get https://github.com/motemen/ghq
     error lstat /Users/kazu/g/src: no such file or directory

I found ghq list does not work too.

%  ghq list
     error failed to filter repos while walkLocalRepositories(repo): lstat /Users/kazu/g/src: no such file or directory
@Songmu
Copy link
Member

Songmu commented May 8, 2019

This behavior changed after #60 is merged.

I made this change because I thought it would be better to raise the error clearer than to ignore if the directory doesn't exist.

However, it may be better to create automatically when we ghq get. Even in the case of ghq list, it is possible to specify a relative path such as ./vendor in GHQ_ROOT, so it may be better not to raise an error after listing the primary root.

@znz
Copy link
Author

znz commented May 9, 2019

Thank you for your explanation.
I understand changing behavior.
So I create the directory or unset nonexistent directory from ghq.root.

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

2 participants