Граф коммитов

2046 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić 0a789d77dd Allow displaying help for extended hub commands: `hub help hub-<CMD>`
For compatibility with git, `hub help checkout` will display the help
for git-checkout and there will be no information about hub extensions
to this command.

Now with `hub help hub-checkout`, hub will print the help text from
hub's extension to git-checkout.
2016-01-25 02:30:46 +11:00
Mislav Marohnić 0a45aa8ddc Reformat inline command help and expand usage options 2016-01-25 02:30:46 +11:00
Mislav Marohnić 1918e011a6 Restructure how command usage is stored and displayed
- No more `c.Short` property. Instead, the first line of `c.Long`
  property is considered a short command description.

- The `c.Usage` text can now contain multiple lines.

- The new `c.Synopsis()` method renders usage synopsis for humans:

    Usage: hub my-command --arg
           hub my-command --alternative-arg

- The new `c.HelpText()` method renders synopsis + full help text.
2016-01-25 02:23:26 +11:00
Mislav Marohnić 9c9ff2d341 go fmt 2016-01-25 02:20:49 +11:00
Mislav Marohnić 3281cfb6f0 Suggest that Go 1.5.3 or higher is required 2016-01-25 02:20:49 +11:00
Mislav Marohnić b4e8ab6b8b Merge pull request #1054 from jamesqo/master
Don't corrupt the PATH if longer than 1024 characters on Windows
2016-01-24 13:28:53 +11:00
James Ko 84c9bf7550 Fix a few syntactic errors after local testing 2016-01-23 15:18:24 -05:00
Mislav Marohnić 00adf54193 Merge pull request #1084 from github/help-improvements
Help text improvements
2016-01-22 22:55:44 +11:00
Mislav Marohnić 44a4761edf Have `hub help hub` open hub man page 2016-01-22 22:47:17 +11:00
Mislav Marohnić 7bb983648d Append to `git help` output instead of hardcoding it 2016-01-22 22:47:17 +11:00
Mislav Marohnić 4191e65d74 Avoid including `--version` in `hub help -a` output 2016-01-22 22:12:55 +11:00
Mislav Marohnić a311d9c257 Merge pull request #1083 from github/local-cloneable
Improve detecting local clone resources
2016-01-22 21:30:13 +11:00
Mislav Marohnić 70cfee2094 Prompt for credentials when running unauthenticated `git init -g`
Fixes #862
2016-01-22 21:27:40 +11:00
Mislav Marohnić 1d519fe496 Enable fetching from local git bundle 2016-01-22 21:13:45 +11:00
Mislav Marohnić c3ddec3248 Improve detecting local clone resources
In `hub clone NAME`, "NAME" was previously considered a local resource
if a directory of the same name existed, and the clone command was left
unchanged.

That worked for a while, but some users were surprised that they
couldn't clone their repo named "NAME", only to discover that there was
an unrelated directory "NAME" in the current working directory.

Also, a git bundle is a valid cloneable resource, but is a file and not
a directory.

This refines the detection of cloneable resources. "NAME" is considered
to be locally cloneable if one of the following is true:

- "NAME/.git" exists
- "NAME" is a bare git repo
- "NAME" is a file whose first line includes "git bundle"
2016-01-22 20:47:51 +11:00
Mislav Marohnić 97954a227c Merge pull request #829 from darabos/release-commitish-flag
Add new flag to "release" for specifying commitish
2016-01-22 17:29:52 +11:00
Mislav Marohnić 7226fc72c3 Merge pull request #1082 from github/go-homedir
Avoid "user: Current not implemented" error
2016-01-22 17:18:17 +11:00
Mislav Marohnić f6bc4d73b3 Avoid using `user.Current()` during OAuth process
Detect current username without resorting to cgo
2016-01-22 16:03:47 +11:00
Mislav Marohnić 9048d4fb16 Switch from `user.Current()` to mitchellh/go-homedir
Sometimes when hub is cross-compiled, `user.Current()` won't work on
certain systems. Use an alternative way of obtaining the user's home
directory.
2016-01-22 16:03:47 +11:00
Mislav Marohnić 19017f9300 Merge branch 'go-1.5-vendor-experiment' 2016-01-22 16:01:10 +11:00
Mislav Marohnić 46a5050109 Properly nest sub-dependencies 2016-01-22 02:10:35 +11:00
Mislav Marohnić 0bbe55b2f6 Merge remote-tracking branch 'origin/clone-usage' 2016-01-22 01:37:26 +11:00
Mislav Marohnić b33ab4f466 Handle all sorts of weird git remote URLs
- git+ssh://github.com/...
- ssh://github.com:22/...
- git@github.com:/...

Fixes #876
2016-01-22 01:28:31 +11:00
Mislav Marohnić 3e69b8ecff Merge branch 'unknown-shell' 2016-01-21 18:24:07 +11:00
Mislav Marohnić b9077e37e6 Improve "unknown shell" output 2016-01-21 18:23:28 +11:00
Rex Schrader 5c74821593 Clarify "Unknown Shell" Error Message
In instances where the `SHELL` environment variable is not set, nor is the `-s` parameter set it is not clear what action should occur.  Clarify the error message to make it obvious.

Closes #1065

Untested.
2016-01-20 22:56:02 -08:00
James Ko faae9420d0 Add comments 2016-01-20 18:43:44 -05:00
Mislav Marohnić 4a0b0e9cf5 Godeps is no more 2016-01-20 16:14:01 +11:00
Mislav Marohnić d0ee8f64f3 Fix `script/build test` after moving to `vendor/` directory 2016-01-20 16:13:35 +11:00
Mislav Marohnić 753c0c55f0 Avoid `script/format` affecting files under `vendor/` 2016-01-20 15:08:24 +11:00
Mislav Marohnić 1b862e3388 Switch from godep & rewriting import paths to GO15VENDOREXPERIMENT 2016-01-20 14:46:44 +11:00
Mislav Marohnić d0ad43d47c Have `script/boostrap` generate binstubs 2016-01-20 14:03:07 +11:00
Mislav Marohnić a77104fc39 Fix `browse` opening current branch pushed to fork
Fixes #896
2016-01-20 14:01:19 +11:00
Mislav Marohnić 648f25cf2f Fix assigning user to pull request without labels
Fixes #1057
2016-01-20 13:46:59 +11:00
Mislav Marohnić 21ab7c7899 Merge pull request #1077 from kbrock/rename_gh
rename gh command to hub in docs
2016-01-20 13:21:55 +11:00
Keenan Brock 5355655711 rename gh command to hub in docs 2016-01-19 13:31:47 -05:00
Mislav Marohnić 6946091963 Merge pull request #1073 from kbrock/clone_docs
document that clone directory is optional
2016-01-19 20:57:44 +11:00
Keenan Brock fc197be6c0 document that clone directory is optional 2016-01-10 15:23:49 -05:00
James Ko 0f6a3423e5 Fix 1024 character limit with setx
setx will automatically truncate the PATH to 1024 characters if it is longer than that. It also mixes the local user's path with the machine-wide path, which is no good.

Unfortunately, the only way around this is running PowerShell to set the PATH manually.

Related link: http://superuser.com/questions/387619/overcoming-the-1024-character-limit-with-setx
2015-12-13 15:54:31 -05:00
Mislav Marohnić 35c76bf91d Merge pull request #1044 from parkr/handle-missing-origin-remote
commands/fork: handle missing "origin" remote
2015-12-08 10:26:02 +01:00
Parker Moore b9af721102 features/fork: remove unnecessary API server. 2015-12-08 00:33:12 -08:00
Parker Moore 0b77c06df5 fork: Check for existence of origin remote before forking. 2015-12-05 10:14:59 -08:00
Parker Moore fb27eeb6f6 commands/fork: handle missing "origin" remote
Fixes nil reference crash. Fixes #1042.
2015-12-03 12:08:58 -08:00
Mislav Marohnić 1202fc4d39 Merge pull request #1024 from github/cache-git-dir
Cache result of `git rev-parse --git-dir`
2015-11-04 11:19:04 +01:00
Mislav Marohnić 2617a13092 Merge pull request #1025 from madhusudancs/parse-remote-for-pushurl
Another attempt at fixing pull-request command for fetch-only remotes.

References #876
2015-11-04 11:18:25 +01:00
Madhusudan.C.S 209d5b0d4c Parse and store both fetch and push URLs from git remotes.
It is a common practice to set the push URL of the "upstream" repository to an
invalid URL to avoid accidentally pushing to upstream instead of a fork. The
trouble with the current approach of obtaining remote URLs is that, the URL
obtained for a remote might not be the valid one, even though a valid remote
fetch URL exists. For example, git remote -v might return the following output

~$ git remote -v

origin      https://github.com/owner/project.git (fetch)
origin      https://github.com/owner/project.git (push)
upstream    https://github.com/main/project.git (fetch)
upstream    no_push (push)

But github.Remotes() currently parses both these URLs but stores only one of
them, the one that comes the last in git remote -v output, for a given remote.
So in this example, the URL for upstream remote might end up to be "no_push"
instead of https://github.com/main/project.git. This causes problems
downstream. For example, pull-request can't proceed with non github.com URLs
and the command fails even when a valid fetch URL for upstream is defined.

This commit fixes the problem by parsing and storing both fetch and push URLs
for each remote. So later, wherever the URLs are required, we can either
look at fetch URL or push URL or both depending on what is required.

Fixes one part of issue #876. Still doesn't recognize "git+ssh" protocol
scheme.
2015-11-02 15:55:05 -08:00
Madhusudan.C.S 90a4f3d7a9 Add a cucumber test to verify that pull-request works with fetch-only upstream remote. 2015-11-02 15:55:05 -08:00
Madhusudan.C.S 29317d283e Add unit tests for git.Remotes() and github.Remotes().
Also, define AddRemote() method for test Repo fixture.
2015-11-02 15:55:05 -08:00
Mislav Marohnić e6823e8d18 Cache result of `git rev-parse --git-dir`
It's invoked often from different methods, but always has the same
results. Cache it after the 1st run so subsequent runs are no-ops.

Before:

    HUB_VERBOSE=1 git browse
    $ git config alias.browse
    $ git rev-parse -q --git-dir
    $ git rev-parse -q --git-dir
    $ git remote -v
    $ git rev-parse -q --git-dir
    $ git config hub.host
    $ git rev-parse -q --git-dir
    $ git config push.default
    $ git rev-parse -q --git-path refs/remotes/origin/no-angular
    $ git rev-parse -q --git-dir
    $ git rev-parse -q --git-dir
    $ git rev-parse -q --git-dir

After (6 fewer invocations):

    HUB_VERBOSE=1 git browse
    $ git config alias.browse
    $ git rev-parse -q --git-dir
    $ git remote -v
    $ git config hub.host
    $ git config push.default
    $ git rev-parse -q --git-path refs/remotes/origin/no-angular
2015-10-31 18:05:37 +01:00
Mislav Marohnić 923402ad1a Go formatting fixes
[ci skip]
2015-10-31 01:52:17 +01:00