Giter VIP home page Giter VIP logo

ghq's Introduction

ghq(1) Build Status Coverage

NAME

ghq - Manage remote repository clones

DESCRIPTION

'ghq' provides a way to organize remote repository clones, like go get does. When you clone a remote repository by ghq get, ghq makes a directory under a specific root directory (by default ~/ghq) using the remote repository URL’s host and path.

$ ghq get https://github.com/x-motemen/ghq
# Runs `git clone https://github.com/x-motemen/ghq ~/ghq/github.com/x-motemen/ghq`

You can also list local repositories (ghq list).

SYNOPSIS

ghq get [-u] [-p] [--shallow] [--vcs <vcs>] [--look] [--silent] [--branch] [--no-recursive] [--bare] <repository URL>|<host>/<user>/<project>|<user>/<project>|<project>
ghq list [-p] [-e] [<query>]
ghq create [--vcs <vcs>] <repository URL>|<host>/<user>/<project>|<user>/<project>|<project>
ghq rm [--dry-run] <repository URL>|<host>/<user>/<project>|<user>/<project>|<project>
ghq root [--all]

COMMANDS

get

Clone a remote repository under ghq root directory (see DIRECTORY STRUCTURES below). ghq clone is an alias for this command. If the repository is already cloned to local, nothing will happen unless '-u' ('--update') flag is supplied, in which case the local repository is updated ('git pull --ff-only' eg.). When you use '-p' option, the repository is cloned via SSH protocol.
If there are multiple ghq.root s, existing local clones are searched first. Then a new repository clone is created under the primary root if none is found.
With '--shallow' option, a "shallow clone" will be performed (for Git repositories only, 'git clone --depth 1 …​' eg.). Be careful that a shallow-cloned repository cannot be pushed to remote. Currently Git and Mercurial repositories are supported.
With '--branch' option, you can clone the repository with specified repository. This option is currently supported for Git, Mercurial, Subversion and git-svn.
The 'ghq' gets the git repository recursively by default.
We can prevent it with '--no-recursive' option. With '--bare' option, a "bare clone" will be performed (for Git repositories only, 'git clone --bare …​' eg.).

list

List locally cloned repositories. If a query argument is given, only repositories whose names contain that query text are listed. '-e' ('--exact') forces the match to be an exact one (i.e. the query equals to project, user/project or host/user/project) If '-p' ('--full-path') is given, the full paths to the repository root are printed instead of relative ones.

root

Prints repositories' root (i.e. ghq.root). Without '--all' option, the primary one is shown.

rm

Remove local repository. If '--dry-run' option is given, the repository is not actually removed but the path to it is printed.

create

Creates new repository.

CONFIGURATION

Configuration uses 'git-config' variables.

ghq.root

The path to directory under which cloned repositories are placed. See DIRECTORY STRUCTURES below. Defaults to ~/ghq.
This variable can have multiple values. If so, the last one becomes primary one i.e. new repository clones are always created under it. You may want to specify "$GOPATH/src" as a secondary root (environment variables should be expanded.)

ghq.<url>.vcs

ghq tries to detect the remote repository’s VCS backend for non-"github.com" repositories. With this option you can explicitly specify the VCS for the remote repository. The URL is matched against '<url>' using 'git config --get-urlmatch'.
Accepted values are "git", "github" (an alias for "git"), "subversion", "svn" (an alias for "subversion"), "git-svn", "mercurial", "hg" (an alias for "mercurial"), "darcs", "fossil", "bazaar", and "bzr" (an alias for "bazaar").
To get this configuration variable effective, you will need Git 1.8.5 or higher.

ghq.<url>.root

The "ghq" tries to detect the remote repository-specific root directory. With this option, you can specify a repository-specific root directory instead of the common ghq root directory.
The URL is matched against '<url>' using 'git config --get-urlmatch'.

Example configuration (.gitconfig):

[ghq "https://git.example.com/repos/"]
vcs = git
root = ~/myproj

ENVIRONMENT VARIABLES

GHQ_ROOT

If set to a path, this value is used as the only root directory regardless of other existing ghq.root settings.

DIRECTORY STRUCTURES

Local repositories are placed under 'ghq.root' with named github.com/user/repo.

~/ghq
|-- code.google.com/
|   `-- p/
|       `-- vim/
`-- github.com/
    |-- google/
    |   `-- go-github/
    |-- motemen/
    |   `-- ghq/
    `-- urfave/
        `-- cli/

INSTALLATION

macOS

brew install ghq

Void Linux

xbps-install -S ghq

GNU Guix

guix install ghq

Windows + scoop

scoop install ghq

go get

go install github.com/x-motemen/ghq@latest

conda

conda install -c conda-forge go-ghq
asdf plugin add ghq
asdf install ghq latest
mise install ghq
mise use ghq

build

git clone https://github.com/x-motemen/ghq .
make install

Built binaries are available from GitHub Releases. https://github.com/x-motemen/ghq/releases

HANDBOOK

You can buy "ghq-handbook" from Leanpub for more detailed usage.

The source Markdown files of this book are also available for free from the following repository.

Currently, only Japanese version available. Your translations are welcome!

ghq's People

Contributors

at-grandpa avatar autopp avatar github-actions[bot] avatar gmidorii avatar hezhizhen avatar itchyny avatar jjv avatar johejo avatar jyjyjcr avatar k0kubun avatar kentaro avatar knu avatar makimoto avatar mattn avatar motemen avatar moznion avatar msh5 avatar nathanbaulch avatar okabe-junya avatar osamu2001 avatar rhysd avatar shogo82148 avatar sixeight avatar songmu avatar sorah avatar syohex avatar tcnksm avatar tockn avatar xeres avatar yoichi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghq's Issues

ghq.root should be able to be specified on a per URL basis

If we're using conditional includes in the global gitconfig (like this example), any git commands run in different directories may have invalid responses.

It would be very useful if (in conjunction with #109) you could specify a the git.root inside the VCS config block and then use that to cd before any other commands.

Example:

# .gitconfig-work
[url "[email protected]:"]
  insteadOf = gl:
  insteadOf = ssh://gl/
  insteadOf = https://gl/
# .gitconfig
[includeIf "gitdir:~/code/work/"]
  path = .gitconfig-work

[ghq "gl:"]
  root = ~/code/work

Can't clone repository

I'm using ghq get command, but there are some errors as below.

 error Could not find version control system: https://hogehoge.com/hogehoge

How do I do to fix this error?

  • using GitHub Enterprise
  • using Mac

ghq fails to clone or list if files or directories in the GHQ_ROOT are not accessable

This looks similar to #165, but instead of a dangling symlink, I have directories which are root owned. It's probably a little odd, but I have my GHQ_ROOT set to the root of a macOS volume. In there are several root owned directories (.Trashes, .Spotlight-V100 and .fseventsd).

In my opinion, skipping over inaccessible directories, or possibly directories starting with a dot would be a good idea. As is, after updating my ghq, no operations work anymore:

ghq get https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
     error open /Volumes/code/.Spotlight-V100: permission denied

After disabling spotlight indexing and removing that directory, the next one is .Trashes:

$ ghq list
     error failed to filter repos while walkLocalRepositories(repo): open /Volumes/code/.Trashes: permission denied

Feature request: specify vcs argument on `ghq list`

It'd be nice to be able to filter working directories by VCS.
This is useful in the case to run git-gc on all local Git repositories.

for line in $(ghq list --full-path --vcs=git); do
  git gc --aggressive
done

Please tell me your opinions.
If my request be accepted, I will prepare PR to support this feature.

How to clone submodules in a repository?

Hi,
I'd like to clone some repository containing submodules.
With git, submodules can be cloned by git clone --recursive.
But ghq get does not look to have --recursive option.
How to clone submodules in a repository?

Feature request: search github for repos and import first result

I understand this would add a significant amount of code to this project, but I think it would be really nice to be able to search Github for a repo and import the first result (maybe after confirmation).

Ex:

$ ghq get ghq

would search Github for ghq and import this project without having to type:

$ ghq get motemen/ghq

can't set multi ghq.root.

i set ghq.root in .gitconfig, but ghq don't work..

my gitconfig is as follows.

[ghq]
	root = ~/dev/src
	root = ~/.go/src

i execute ghq root --allcommand, ~/dev/src is obtained....

Please tell me how to work correctly.

Create gitter room

I want to gitter room for this repository, ghq because I want to talk about ghq questions.

Is there any demand for gitter room?

Add some kind of transforms for "ghq.<url>."

Instead of doing this:

ghq get [email protected]:20022/group/project.git 

I want to do this:

ghq get my-repo-server.example.com/group/project

I'ts similar to what GIT's url.<base>.pushInsteadOf does but more powerful
and specifically for GHQ.

quickly thrown together configuration example

The URL in [ghq "my-repo-server.example.com/"] becomes a simple prefix string
matcher which then looks at match/replace to construct the final URLs.

Conceptually it could work something like this but there are probably more use
cases to think about.

[ghq "my-repo-server.example.com/"]
  vcs = git
  match = my-repo-server.example.com/(?P<rest>.*)/+
  replace = [email protected]:20022/${rest}.git

Forcefully overriding https with .git:

[ghq "https://my-repo-server.example.com/"]
  vcs = git
  match = https://my-repo-server.example.com/(?P<rest>.*)/+
  replace = [email protected]:20022/${rest}.git

And configure sub paths of hosts to be translated where the longest match wins(?):

[ghq "github.com/"]
  vcs = git
  match = github.com/(?P<rest>.*)
  replace = https://github.com/{rest}
  
[ghq "github.com/thomasf/"]
  vcs = git
  match = github.com/thomasf/(?P<rest>.*)/+
  replace = [email protected]:thomasf/{rest}.git

Having "DEPRECATED Action signature." message

Currently, I am having following message, whenever I execute ghq related command.

DEPRECATED Action signature.  Must be `cli.ActionFunc`.  This is an error in the application.  Please contact the distributor of this application if this is not you.  See https://github.com/codegangsta/cli/blob/master/CHANGELOG.md#deprecated-cli-app-action-signature

It's just because codegangsta/cli a dependent library of ghq was updated.
Do you have any idea how I can get rid of this message?

compiled binary does not work well

I tried ghq_darwin_amd64.zip v0.4. But it shown runtime.panic.
I expected binary package does not need go runtime, should I install go runtime?

$ ./ghq get https://github.com/motemen/ghq
panic: user: Current not implemented on darwin/amd64

goroutine 1 [running]:
runtime.panic(0x2d9d60, 0x210874e40)
    /usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/motemen/ghq/utils.PanicIf(0x802e80, 0x210874e40)
    /home/ubuntu/go/src/github.com/motemen/ghq/utils/log.go:50 +0x4f
main.localRepositoryRoots(0x5aab2, 0x21087ac72, 0x4)
    /home/ubuntu/go/src/github.com/motemen/ghq/local_repository.go:174 +0xf1
main.walkLocalRepositories(0x22109a3950)
    /home/ubuntu/go/src/github.com/motemen/ghq/local_repository.go:126 +0x1e
main.LocalRepositoryFromURL(0x2108935b0, 0x2108935b0)
    /home/ubuntu/go/src/github.com/motemen/ghq/local_repository.go:58 +0x29c
main.getRemoteRepository(0x8034a0, 0x210832370, 0x210830000)
    /home/ubuntu/go/src/github.com/motemen/ghq/commands.go:184 +0x4e
main.doGet(0x210895160)
    /home/ubuntu/go/src/github.com/motemen/ghq/commands.go:176 +0x2f9
github.com/codegangsta/cli.Command.Run(0x371e60, 0x3, 0x0, 0x0, 0x3ca190, ...)
    /home/ubuntu/go/src/github.com/codegangsta/cli/command.go:97 +0xbde
github.com/codegangsta/cli.(*App).Run(0x210896000, 0x21083c000, 0x3, 0x3, 0x21f50, ...)
    /home/ubuntu/go/src/github.com/codegangsta/cli/app.go:125 +0x901
main.main()
    /home/ubuntu/go/src/github.com/motemen/ghq/main.go:12 +0x52

go getでインストールしようとしたらエラーが出た

go getでインストールしようとしたところ

~/.go/bin$ go get github.com/motemen/ghq
# github.com/motemen/ghq
../src/github.com/motemen/ghq/commands.go:37: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:38: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:39: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:55: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:56: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:57: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:88: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:89: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:90: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:103: too few values in struct initializer
../src/github.com/motemen/ghq/commands.go:103: too many errors

と出てきてしまい、インストールすることができませんでした。
https://github.com/codegangsta/cli
こちらの影響ぽかったので、tag: 1.1.0に戻すとインストールすることが出来ました。
直していただけると助かります。

Feature request: Remove/delete a repo

Please enable us to remove/delete a cloned repo through ghq. Currently, I have to delete them manually. And if possible, I want to be able to remove an organization like github.com, or an account under that organization, like github.com/singularitti/. Thank you!

Feature request: add ability to also specify vcs as an argument to `ghq get`

Given that we can force the vcs in the gitconfig, it'd be nice to be able to specify it on the ghq get command-line and have it automatically store that information in gitconfig for us. That was the first place I looked when wanting to explicitly set the vcs, and only found the configuration via re-reading the README.

`ghq get rails`

I can write gem 'rails', :github => 'rails' in Gemfile.
Similarly, I want to ghq get rails instead of ghq get rails/rails.

http://bundler.io/v1.6/git.html says

If the repository name is the same as the GitHub account hosting it, you can omit it

Username given in URL gets lost if using SSH with Git

When giving a username along with repo URL (both using HTTP(S) or SSH) it gets reverted to git if SSH is preferred using -p switch.

This has no actual effect with Github, but manifests with custom - especially on-site hosted - repositories and their access control.

`ghq list` stops list when non-directory encountered

The ghq list [<query>] command stops listing matches when a non-directory. This is not a show-stopper, but it was making me think I had lost my mind this morning, when I would successfully ghq get … then a ghq list jps3/ would stop listing items after the first few. Sometime in the past few days it appears I mistakenly edited a text file in the ~/.ghq/github.com/jps3/ directory, and I noticed that in normal sorting it came right after the first few items which were being returned with ghq list jps3/. Once I removed that file, all was right in my ghq world again.

Found/tested on OS X 10.10.5 (14F27) and ghq version 0.7.1 (installed via Homebrew).

Example:

$ ghq list motemen/
github.com/motemen/ghq
$ cd ~/.ghq/github.com/motemen
$ ls -l
total 0
drwxr-xr-x  27 jps3  staff  918 Sep 23 10:12 ghq
$ touch foo
$ ls -l 
total 0
-rw-r--r--   1 jps3  staff    0 Sep 23 10:14 foo
drwxr-xr-x  27 jps3  staff  918 Sep 23 10:12 ghq
$ ghq list motemen/
$ 
$ rm foo
$ ghq list motemen/
github.com/motemen/ghq
$ touch zoo
$ ls -l
total 0
drwxr-xr-x  27 jps3  staff  918 Sep 23 10:12 ghq
-rw-r--r--   1 jps3  staff    0 Sep 23 10:16 zoo
$ ghq list motemen/
github.com/motemen/ghq
$ rm zoo
$ mkdir foo.d
$ ghq list motemen/
github.com/motemen/ghq
$ rmdir foo.d

Perhaps someone else has run into this and been a bit flummoxed as well. Also, maybe this is an easy one to fix (if so, you are welcome).

`--full-path` option show the relative paths with the relative `root`

  1. Set relative paths in .gitconfig

    [ghq]
    root = ~/.go/src
    root = ./vendor
  2. Run ghq list with --full-path, -p option

    $ cd /path/to/some/golang/repo
    $ ghq list -p
    /Users/delphinus/.go/src/github.com/mattn/gom
    /Users/delphinus/.go/src/github.com/mattn/gover
    /Users/delphinus/.go/src/github.com/mattn/goveralls
    
    ...
    
    vendor/github.com/BurntSushi/toml
    vendor/github.com/urfave/cli

I think the last two paths should be absolute, such as...

/path/to/some/golang/repo/vendor/github.com/BurntSushi/toml
/path/to/some/golang/repo/vendor/github.com/urfave/cli

Is it the specification, or the bug?

listing local repositories is very slow since recent changes

It take about 5 seconds now:

real    0m5.194s
user    0m2.436s
sys 0m2.172s

360 entries listed

I quickly tried using https://github.com/MichaelTJones/walk which helps a bit:

real    0m1.755s
user    0m3.208s
sys 0m2.064s

360 entries listed

Reverting back to 53c4cae (bump version to 0.7.3) the speed is up again:

real    0m0.028s
user    0m0.004s
sys 0m0.012s

355 entries listed

For most situations I rather go back to the old behaviour in most situations if it isn't possible to solve this somewhere else.. Maybe adding an option to stop traversal is a good idea?

I also tried using MichaelTJones/walk on 53c4cae but that only listed one repository so it's not working well there.. I havent had time to really read through the changes now so I'll be using 53c4cae as a temporary workaround.

Feature request: fork then clone

git-extras has a fork then clone command that'd be handy to add here as well.
I realize it would be a bit difficult to make it non Github-specific but I'd be more than happy with just Github support for starters.

EDIT:
ghq get -f <github_repo for syntax would be awesome.

Suggestion: Make new configure file instead of git-config

Hi, @motemen,

Now ghq's configuration gets complex.
Currently ghq's configuration rents a space from git-config, but I think that it's a time to make the configuration file for ghq.

Have you thought about separating ghq configuration from git-config to another configuration file? ($HOME/.ghqconfig or something)

ghq should drop the port from the folder name

Some of the projects I work on are stored in private git repos where the SSH daemon is listening to a custom port. When using ghq, I noticed that the folder created by ghq contains :<port_number> which is not desirable IMO.

Proposal: Change `root` command --all flag true by default

Hello, @motemen

I think it's a good idea to set root command --all flag true by default.
Currently, we can show all repositories root like this.

$ ghq root --all

But by default, $ ghq root always shows a one repository root.
It may cause a little bit to confuse because we can configure ghq.root more than one.

Installation does not complete on Ubuntu 19.04

Installation with 'go get' does not complete on Ubuntu Server 19.04.

My environments are ...

$ go version
go version go1.10.4 linux/amd64
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.04
Release:        19.04
Codename:       disco

This is how to install ghq with 'go get'

go get github.com/motemen/ghq
# github.com/motemen/ghq
go/src/github.com/motemen/ghq/local_repository.go:265:19: undefined: os.UserHomeDir

Anyidea do you have?

Release for 0.7.6?

I noticed installing like this: go get github.com/motemen/ghq gets me ghq version is 0.7.6, but there's only releases up to 0.7.4.

Meaning GHQ?

I just really wonder what GHQ stands for. It will help me remember the command to type in the terminal.

Git clone should be able to respect `insteadOf` configuration

I'm currently using insteadOf to alias my company's gitlab instance and force SSH like this:

[url "[email protected]:"]
        insteadOf = gl:
        insteadOf = ssh://gl/
        insteadOf = https://gl/

This mostly works when using ghq, except that the directory name is created before running git ls-remote.

Actual/Expected output shown in the diff below:

$ ghq get gl:foo/bar
clone ssh://gl/foo/bar -> /Users/fotios/src/gl/foo/bar
git clone ssh://gl/foo/bar /Users/fotios/src/gl/foo/bar
- Cloning into '/Users/fotios/src/gl/foo/bar'
+ Cloning into '/Users/fotios/src/gitlab.mycompany/foo/bar' 

This can also be used instead to augment specifying -p since insteadOf can be used to force HTTPS/SSH depending on the path.

ghq look overwrite $OLDPWD

So I could not return to previous directory ( e.g $ cd - )

Example

$ cd ~/
$ ghq look github.com/YumaInaura/dotfiles
cd /Users/yuma/.ghq/github.com/YumaInaura/dotfiles
$ env | grep PWD
PWD=/Users/yuma/.ghq/github.com/YumaInaura/dotfiles
OLDPWD=/Users/yuma/.ghq/github.com/YumaInaura/dotfiles

My versions

  • ghq version 0.8.0
  • zsh 5.5.1 (x86_64-apple-darwin17.5.0)
  • Max OS X High Sierra

ghq browse to open the project page in a browser

It would be handy if ghq could open the project page that corresponds to a repository in a browser. For example:

% ghq get -p foo/proj1
% ghq look foo/proj1
% ghq browse  # opens up a browser

and/or simply

% ghq browse foo/proj1

from anywhere outside the repo.

There are a few considerations though:

  • Some heuristics may be necessary to identify the project page
  • An extra configuration variable in .gitconfig may be preferable to configure the browser to use.

What do you think?

ghq(1) gets panic if current working directory is removed

I have reported it here for information, but I expect that it is a kind of "wontfix" issue because it occurs in an abnormal environment.

Env

  • ghq 0.8.0 installed via homebrew

How to reproduce

  1. Open two terminals with the same cwd
  2. Runmkdir foo in one terminal
  3. Run rmdir foo in another terminal
  4. Run ghq root in the first terminal

output:

fatal: Unable to read current working directory: No such file or directory
panic: exit status 128

goroutine 1 [running]:
github.com/motemen/ghq/utils.PanicIf(0x124f700, 0xc42008ad80)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/motemen/ghq/utils/log.go:53 +0x4a
main.localRepositoryRoots(0x3, 0xc42006c660, 0x119b600)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/local_repository.go:195 +0x485
main.primaryLocalRepositoryRoot(0xc4200906e0, 0x119b2b8)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/local_repository.go:219 +0x22
main.doRoot(0xc4200906e0, 0x0, 0xc4200906e0)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/commands.go:453 +0x158
github.com/urfave/cli.HandleAction(0x116ab00, 0x11a5c98, 0xc4200906e0, 0xc42006c600, 0x0)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/urfave/cli/app.go:490 +0xd4
github.com/urfave/cli.Command.Run(0x119b4e1, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x119f53e, 0x17, 0x0, ...)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/urfave/cli/command.go:210 +0xb6e
github.com/urfave/cli.(*App).Run(0xc420052ea0, 0xc42008a080, 0x2, 0x2, 0x0, 0x0)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/urfave/cli/app.go:255 +0x76f
main.main()
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/main.go:12 +0x53

Don't go into a subshell, just cd

It would be cool if ghq look just ran cd ... instead of going into a subshell. (The subshell feature annoys me actually...). Or at least add a configuration for it?

Support PowerShell for 'look' command

On Windows the 'look' command uses COMSPEC so it will start a cmd.exe shell. If the user is working in a PowerShell shell this is not what they'd want to do.

I expected it just to 'cd', but starting a new shell makes sense. Could there be a way to override this by checking for a GHQ_SHELL variable before checking COMSPEC?

`ghq` does not work well with multiple ghq.root with nonexistent directory

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

Default value for `ghq.root`

Currently ghq.root defaults to ~/.ghq, which seems not convenient very well. Can we have more-suitable default value?

Or showing a prompt to configure ghq.root on first startup of ghq?

RFC: Support Go 1.3 (undefined: atomic.Value in mitchellh/go-homedir)

I'm not really sure which to report this issue but I'm using your ghq and not go-homedir thus I decide to report the issue here.
Well, when I tried to install this program by go get github.com/motemen/ghq, the command fail with

../../../.go/src/github.com/mitchellh/go-homedir/homedir.go:18: undefined: atomic.Value

It seems that the atomic.Value feature was implemented from Go 1.4, and I'm using Go 1.3.3 which is available on Ubuntu 15.04 (ref, the use was implemented in go-homedir at this commit)
So I'll be really happy if you decide to support Go 1.3, which can be installed through apt-get.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.