GithubHelp home page GithubHelp logo

owenthereal / gh Goto Github PK

View Code? Open in Web Editor NEW
719.0 18.0 60.0 3.94 MB

Fast GitHub command line client (deprecated). gh has been merged into https://github.com/github/hub, see https://github.com/github/hub/issues/475 for more info

License: MIT License

Ruby 10.08% Go 57.65% Shell 5.71% Gherkin 26.57%

gh's Introduction

gh's People

Contributors

calavera avatar dgryski avatar jgable avatar joliss avatar jonathonma avatar jonmorehouse avatar jroes avatar mikemcquaid avatar owenthereal avatar pengwynn avatar samnardoni avatar tgkokk 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

gh's Issues

Unexpected Syntax Error in Bash Completion

$ source /usr/local/etc/bash_completion.d/gh.bash_completion.sh
-bash: /usr/local/etc/bash_completion.d/gh.bash_completion.sh: line 187: syntax error near unexpected token `&'
-bash: /usr/local/etc/bash_completion.d/gh.bash_completion.sh: line 187: `          ;;&'

https://github.com/jingweno/gh/blob/master/etc/gh.bash_completion.sh#L187

To make sure I use the latest version I ran

$ brew update 
Already up-to-date.
$ brew upgrade gh
Error: gh-1.0.0 already installed

but I still got the same error.

support multi-arg $EDITOR

self-explanatory i guess:

$ gh pull-request
2013/05/28 18:17:48 fatal: Can't locate git editor: /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -t
$

i invoke emacsclient with a "-t" argument so as to launch a CLI frame instead of a GUI frame.

[Meta] Add Travis CI

I find it kind of ironic that gh ci doesn't work with this repository, because it seems that the GitHub API doesn't support drone.io, since it isn't a service hook and I guess that you have to be "registered" as a CI with GitHub to be integrated in the GitHub API. You can try it with any GItHub repository that is using Travis, the command will work.

Clone via ssh

I never use https with github -- I have a secure (i.e. not particularly easy to type) password and I'm not going to run a special agent thing when I already use ssh-agent for everything else. So for me, ssh works great.

gh doesn't seem like it understands my ssh preference -- when I clone it asks for my password, but it shouldn't need it if it uses ssh. hub only asks for my username, not my password, and uses ssh properly.

Unable to authenticate - x509 failed to load system roots and no roots provided

I upgraded to go 1.1 recently:

jroes$ go version
go version go1.1 darwin/amd64

And then I installed gh using the brew line in the README, but I'm getting this when I try to create a pull request for a project:

github.com password for jroes (never stored):
2013/06/12 22:26:58 fatal: Get https://api.github.com/authorizations: x509: failed to load system roots and no roots provided

A google lead me to some things about disabling cgo, I'm not sure if that has implications on the brew recipe for OSX?

The bigbang release

The issue keeps track of a list of items for the next gh release:

  • Full hub compatibility, #144
  • Man page, #75
  • More git alike command interface, #137
  • Track crashes, #132
  • Bug fixes, #127
  • Site, #142
  • Documentation, #143

We need a blog post announcement for the release as well

"gh help remote" runs "man git-remote", which doesn't outline the features of "gh remote"

Great work, but when I run gh help remote, I get the man page for git remote. The user expects to see a page about the features that gh adds to git remote (namely origin and -p). hub does this too, but I guess that it is supposed to be used as an alias for git, so when you run git help remote, you want to see almost always information for git remote, not hub remote. gh isn't yet supposed to be used as an alias for git, so I can't see why it should provide help for git.

In other words, when I run git help remote, I want to view help for git remote. When I run hub help remote, I probably have git aliased as hub, so I want to view help for git remote. But when I run gh help remote, I don't have aliased git as gh, so I want to view help for gh remote.

I don't know: if you have plans to copy hub and support aliasing to git, then I see why you would keep the current help structure. On the other hand, if you don't have plans to copy hub, IMHO you should change gh help to provide help for gh.

The reason I mention hub is that you state that hub is a reference implementation to gh, so I see where you're coming from.

PS: The above rant is only about non-GitHub-specific commands (commands that are not specific to GitHub - gh remote for example - but are extended by gh). GitHub-specific commands are done right.

Package errors when building gh from source

Just a head's up — running go get github.com/jingweno/gh to install from source (as per the README) doesn't work.

Here's the go install error:

../go-octokit/octokit/response.go:5:2: cannot find package "github.com/lostisland/go-sawyer/mediaheader"

Looks like the lostisland/go-sawyer downloaded by the go tool and the version in Godeps differ.

Explore the possibility of autoupdate

It'd be nice to autoupdate gh. But the performance isn't ideal: #125 (comment). We could prob. do the following:

  • have a last update timestamp in ~/.config/gh
  • automatically check update only once a week

I would still leave the update command since people may want to control the update, like myself :)

Site

We need a new site for gh

Update for installation through dpkg

As mentioned in #125 (comment), the current update implementation may not work for installation through dpkg. My impression so far is there may be no solution to this since it's hard to keep track of how people install gh. Even there is, it'll significantly increase the complexity of the software. Need more investigation to this.

Track crashes

I think it would be a good idea to track crashes automatically when people opt in, maybe it would be even a good idea to let people report issues directly from gh.

It could work like the update, disabled by default, but when gh finds an error, we could ask the user if she wants to send a crash report to us. That would open an issue with information about the crash, like OS version, gh version, stack trace and so on. It would also open the editor so she would be able to write a message.

We could have a setting to set it always enabled, something like autoreport.

gh clashes with git-sh when being evaled in .bashrc

git-sh customizes the git aliases, provides bash completion and adds repo information to the prompt.
When pasting eval "$(gh alias -s)" into .bashrc the colors are just not right. I also got an index error which I can't reproduce right now (unfortunately I didn't copy the traceback right away).
A workaround I found was to eval after .bashrc was sourced either in /etc/gitshrc or ~/.gitshrc but that prevents using gh without git-sh. The workaround should be mentioned in the README file.

Documentation

We need more documentation for gh

  • more doc on authentication
  • more details on commands
  • more in being completely multiplatform and without dependencies rather than focusing it in being fast

Set up CI build for building gh against different platforms

Building gh requires cgo. It's due to a limitation of cross compilation on accessing system root certificates.

The current approach is to use a cross compilation tool to build for the current platforms for i386 and amd64, but it's built on a native platform through virtual box. I'm using this gotask to make a build.

It'd be nice to have ec2 do the job. Also travis-ci seems to support OSX VMs but I never try it.

Relative discussion: #138 (comment)

OSX brew install - Error: wrong number of arguments

Installing on OSX getting:

~  brew install https://raw.github.com/jingweno/gh/master/homebrew/gh.rb
######################################################################## 100.0%
Error: wrong number of arguments
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/Library/Caches/Homebrew/Formula/gh.rb:20:in `test'
/Library/Caches/Homebrew/Formula/gh.rb:20
/usr/local/Library/Homebrew/formula.rb:385:in `require'
/usr/local/Library/Homebrew/formula.rb:385:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:20:in `formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:20:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:20:in `formulae'
/usr/local/Library/Homebrew/cmd/install.rb:25:in `install'
/usr/local/bin/brew:94:in `send'
/usr/local/bin/brew:94

gh pull-request uses incorrect head

While on a branch called keyremap4macbook-9.0.0, gh pull-request tried to make a PR from origin/keyremap4macbook-9.0.0, and failed:

/u/l/L/T/p/Casks git:pckeyboardhack-10.4.0 ❯❯❯ gh pull-request                                                                             V

2013/12/01 22:43:13 fatal: POST https://api.github.com/repos/phinze/homebrew-cask/pulls: 422 - Validation Failed

Error summary:
    missing_field error caused by head_sha field on PullRequest resource
    missing_field error caused by base_sha field on PullRequest resource
    custom error on PullRequest resource: No commits between phinze:master and phinze:pckeyboardhack-10.4.0
// See: http://developer.github.com/v3/pulls/#create-a-pull-request

It should have tried to make a PR from the branch it was tracking, Peeja/keyremap4macbook-9.0.0:

/u/l/L/T/p/Casks git:pckeyboardhack-10.4.0 ❯❯❯ git branch -vv                                                                              V
  keyremap4macbook-9.0.0 779919e [Peeja/keyremap4macbook-9.0.0] Update keyremap4macbook to 9.0.0
  master                 6ccfb4e [origin/master] Merge pull request #1903 from klaustopher/wedge
* pckeyboardhack-10.4.0  691d920 [Peeja/pckeyboardhack-10.4.0] Upgrade pckeyboardhack to 10.4.0.

Automatic updating

I see that you have it in the readme but not as an issue. So, here it is. I'm assigning myself and will start working on it tomorrow. Feel free to give me some ideas for the implementation.

I'm thinking about checking on start every x days (user-configurable amount using git config --global) whether a new release has been released (by getting the latest tag and comparing it with the current version). If there is, the command go get -u github.com/jingweno/gh is automatically run (or there is a prompt, this could be a user-configurable setting too). How does that seem for a starting point?

gh does not respect git aliases

I have noticed that gh does not respect git aliases, depending on how you are implementing git in gh I don't know if this can be done.

In my ~/.gitconfig file I have the following alias to print out a formatted log

[alias]
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --

This works as expected when ran through git but when gh is in the middle it spits out the following error:

git: 'log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --' is not a git command. See 'git --help'.

More git alike command interface

Our custom commands should be more git friendly. We discussed about it briefly in #129 (comment) and I'm opening this issue as a reminder for the future.

Commands with double meaning should be compossible, for instance gh release:

gh release should list the releases in the current project.
gh release create should create a release in the current project.

The same can be applied to issues and pull requests, even if this last one breaks compatibility with hub.

gh 1.0 release

The goal of this release is to demonstrate that gh is ready for daily use. I am thinking the following issues should be resolved for the release:
#75

#101
#99
#74

Among all, #75 has the highest value. I tentatively want to leave #94, #91, #90 and #78 to future releases. But if we could make it in time for any of them, it's definitely a bonus!

Support gist

$ gh gist -d "awesome" file1.go file2.rb

$ gh gist file1.go file2.rb
# open editor for description

$ gh gist file.go
# file.go doesn't exist
# open editor for edit

We could do better than this.

Full hub compatibility

We're not 100% compatible with hub yet. Let's make it happen! There're some tests flagged as "@wip". We need to minimize those.

  • authentication
  • browse
  • clone
  • create
  • fork
  • pull request
  • remote add
  • submodule add

How to build

I'm a total Go newbie, so please forgive my ignorance.

I tried to build this from source just for fun, but running go get in the gh directory fails (and go build fails with the same error message):

$ go get
# code.google.com/p/go.crypto/ssh/terminal
../../.go/src/code.google.com/p/go.crypto/ssh/terminal/terminal.go:517: function ends without a return statement

Am I doing something wrong? I have go version 1.0.2.

Explore the possibility of using libgit2

I'm starting to convert the git layer to read directly from files in the .git dir instead of shelling out to git, e.g., https://github.com/jingweno/gh/blob/pull_in_cucumber_tests/git/git.go#L87-L89. This'll improve performance by reducing the number of shell out calls.

I know libgit2 is trying to do something similar and it'd be interesting to see if we could make use of https://github.com/libgit2/git2go.

This task is not in high priority.

/cc @calavera @technoweenie

Two-factor auth support

I recently discovered gh but immediately hit a snag with authentication as I've enabled two-factor auth, of course this is understandable since 2FA is pretty new.

Are there plans to support 2FA?

Is there a workaround - other than disabling 2FA?

Creating a homebrew formula

I am aware that there is a homebrew formula for installing gh binary. I wish to create a Homebrew formula for building gh from source. Running $ GOPATH=/tmp script/build result in this error

main.go:4:2: cannot find package "github.com/jingweno/gh/commands" in any of:
    /usr/local/Cellar/go/1.1.2/libexec/src/pkg/github.com/jingweno/gh/commands (from $GOROOT)
    /tmp/gh-0.25.1/Godeps/_workspace/src/github.com/jingweno/gh/commands (from $GOPATH)
    /tmp/gh-0.25.1/src/github.com/jingweno/gh/commands
cmd/cmd.go:5:2: cannot find package "github.com/jingweno/gh/utils" in any of:
    /usr/local/Cellar/go/1.1.2/libexec/src/pkg/github.com/jingweno/gh/utils (from $GOROOT)
    /tmp/gh-0.25.1/Godeps/_workspace/src/github.com/jingweno/gh/utils (from $GOPATH)
    /tmp/gh-0.25.1/src/github.com/jingweno/gh/utils
commands/args.go:5:2: cannot find package "github.com/jingweno/gh/cmd" in any of:
    /usr/local/Cellar/go/1.1.2/libexec/src/pkg/github.com/jingweno/gh/cmd (from $GOROOT)
...
...

Neither does go build main.go works. Is there a way I can easily build gh from a release, for example https://github.com/jingweno/gh/archive/v0.25.1.tar.gz ?

Dependency not listed in README

Hi. I tried to install gh today, and I've got the following:

~/dev/go >> go get github.com/jingweno/gh
go: missing Mercurial command. See http://golang.org/s/gogetcmd
package code.google.com/p/go.crypto/ssh/terminal: exec: "hg": executable file not found in $PATH

While the README states that There're no pre-requirements to run gh. Download the binary and go!, this is a bit misleading, 'cause I was also expecting that there were no pre-requirements/dependencies to install from source.

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.