hub 1.11 – codename “What Was Missing”
The long-awaited release of hub is here! You spoke and I listened. Needless to say, this is the best release of hub ever.
hub is a command-line wrapper for git
executable that extends it with features that improve integration with GitHub.
To install hub:
-
Install from source:
git clone https://github.com/github/hub.git cd hub rake install prefix=/usr/local # run and follow the instructions: hub alias
-
Upgrade with Homebrew:
brew upgrade hub
It's faster. Algebraic!
hub is written in Ruby and its execution time was abysmal. It kinda sucks that you're supposed to wrap git
with a tool that's an order of magnitude slower than git itself. Well, the good news is that I've made it much faster in the new release:
v1.10.6:
hub version
- mean: 0.138 mshub browse -u
- mean: 0.191 ms
v1.11.0:
hub version
- mean: 0.062 ms (76 ms faster)hub browse -u
- mean: 0.131 ms (60 ms faster)
I've done that by:
--disable-gems
flag to the Ruby interpreter to skip loading RubyGems;- avoiding loading
fileutils
andcgi
modules, and reimplemented the few methods I need from them; - avoiding loading
yaml
anduri
modules, which are slow to load, and implemented a rudimentary YAML serializer/deserializer to handle hub configuration, and a replacement URI::HTTP class which handles simple URLs.
Ready to squish some long-outstanding issues?
- Enable two-factor authentication (2FA) and email-based GitHub Enterprise login.
- Detect default branch if named something other than "master", e.g. "develop". If the default branch is not picked up by git automatically on clone, you can explicitly set it once per repo with
git remote set-head REMOTE BRANCH
. - Detect origin remote when named something other than "origin", e.g. "upstream" or "github".
- Enable cloning of private repos without having to use
hub clone -p
. hub will use the ssh protocol instead of git protocol for any repo that is private or that you have push access to.
I'm frikkin’ all about pull-request!
- Improve detecting the implicit head of the pull request. For example, if you have push access to the main repository and you created a branch on it,
git pull-request
will no longer incorrectly assume that the head should be the same-named branch on your (possibly non-existent) fork. - Add support for passing the pull request title & body via command line, file, or standard input via the
-m MESSAGE
or-F FILE
parameters that match those supported bygit commit
. - Deprecate converting issues into pull requests. This functionality is likely to be dropped from GitHub's API.
- Save and reuse
pull-request
message if creating one failed. - Avoid hard breaks in
pull-request
message authored in Vim.
New ci-status
command. Mathematical!
hub ci-status
provides access to GitHub Status API and is useful for checking the outcome of CI builds. It prints the status string on standard output and exits with a non-zero code for any status other than "success". This can be useful in shell scripts, e.g. to abort pushing a release if CI is pending or failing.
$ hub ci-status
success
$ hub ci-status mybranch
pending
$ hub ci-status >/dev/null && rake release
Other improvements
hub am
: enable fetching pull request and commit patches from private repos- Improve zsh and bash shell completions (and even added to CI test suite!)
- Escape complex branch names in
browse
URLs - Allow
--ff-only
inmerge <PULL-URL>
- Display
hub help hub
using all available width of the terminal hub version
includes commit SHA when built from git- Fix reading from git
core.pager
when the value contains spaces - Expand environment variables in git
core.editor
value - Skip reading
ssh_config
when no read privileges - Lock down to GitHub API v3 for guarding against future changes of their API
Thanks to the contributors ❤️ ✨
Ladios Jonquil, Dave Goodell, Adam Spiers, Yasuharu Ozaki, Timothy Gu, Tekkub, Stuart Nelson, Steven Harman, Shay Frendt, Mindaugas Mozūras, Mike Dougherty, Michiel Sikkes, Maksim Ryzhikov, Lukas Zapletal, Kirill Müller, John Manoogian III, Jo Liss, Jamie Wright, Ivan Tse, Haukur Páll Hallvarðsson, Glenn Gentzke, David Mai, Arturo Herrero, Aaron Stacy. See the contributors graph