Permalink
Commits on Dec 26, 2013
  1. v1.11.1

    mislav committed Dec 25, 2013
  2. Filter files that are not in version control from the gemspec

    mislav committed Dec 25, 2013
    Keeps unversioned files that I'm currently experimenting with from
    accidentally getting released.
  3. Remove test stuff from the gemspec

    mislav committed Dec 25, 2013
    We can stop pretending that you could run the test suite if you just
    obtained the gem. You'd need the Gemfile for that, and the whole
    Cucumber suite as well.
Commits on Dec 25, 2013
  1. Merge branch 'speed'

    mislav committed Dec 25, 2013
  2. Shell out only once to list git remotes and their URLs

    mislav committed Dec 25, 2013
    Each hub invocation would previously shell out twice to `git remote`:
    1. Once to get the list of available remote names
    2. A second time to obtain remote URLs with `remote -v`
    
    With the new approach, we get the list of available remotes and collect
    their URLs in the same pass. This is part of an effort to reduce the
    number of shelling out to git if not absolutely necessary.
  3. Fix Ruby 1.8 failure with missing stderr in Cucumber test

    mislav committed Dec 25, 2013
    In cukes, we use Aruba which uses ChildProcess to handle spawning of hub
    processes in tests. It uses Tempfile to create file descriptors with
    which stdout and stderr streams are collected from the child process.
    
    However, when hub finished with an `exec`, the stderr in one test would
    be mysteriously blank in Ruby 1.8. I tracked that down to being an issue
    of Ruby not flushing STDERR output to the stream (really a Tempfile in
    the context of tests). https://travis-ci.org/github/hub/jobs/15965636
    
    This hopes to fix the tests, but shouldn't change anything about how hub
    operates normally when invoked directly.
  4. Read default branch for remote from filesystem, not `rev-parse --symb…

    mislav committed Dec 25, 2013
    …olic-full-name`
    
    Assume that the default branch ref is stored in the file located at
    `.git/refs/remotes/origin/HEAD`
    
    This is part of the effort to reduce the number of shelling out to git
    in a single invocation of hub if a more direct alternative is available.
  5. Check if a ref exists using filesystem, not `rev-parse --verify`

    mislav committed Dec 25, 2013
    We presume that if "origin/master" ref exists, that means this file
    represents it: `.git/refs/remotes/origin/master`.
    
    This is part of the effort to reduce the number of shelling out to git
    if an alternative, more direct approach is available.
  6. Read the current git branch directly from `.git/HEAD`

    mislav committed Dec 25, 2013
    This operates on a presumption that `.git/HEAD` will be in this format
    when currently on a checked-out branch:
    
        ref: refs/heads/master
    
    This change is part of the effort to reduce the number of shelling out
    to git in a single invocation of hub.
  7. Avoid shell redirection to silence stderr when shelling out

    mislav committed Dec 25, 2013
    Shelling out to `git`, which by itself takes ~6ms, used to consistently
    take 8-11ms in hub. Due to the number of different data we have to
    collect from git, this overhead is the leading cause of slow execution.
    
    Turns out, when we don't use shell redirection, but silence STDERR
    ourselves in Ruby, this overhead is gone and the time spent shelling out
    is much closer to git execution time.
  8. Lazily read "hub.host" configuration only when necessary

    mislav committed Dec 24, 2013
    For speed, we want to reduce the number of shelling out to git in a
    single invocation of hub, and reading from "hub.host" is unnecessary if
    the current hostname matches the default host ("github.com"), which is
    the most common case.
  9. Only access ssh_config for hosts other than "github.com"

    mislav committed Dec 24, 2013
    Assume that "github.com" is not an ssh alias to anywhere else. This
    optimizes the most common case in which all remotes in a repository
    point to "github.com" in their URLs and in which we can avoid
    instantiating SshConfig altogether.
  10. Reduce features in SshConfig scanner for speed

    mislav committed Dec 24, 2013
    A lot of hub execution time was spent in SshConfig, which was a
    reasonably compatible reader implementation for the format described in
    ssh_config(5). However, all we ever used this functionality for is
    resolving hostname aliases the same way `ssh` on the command-line does.
    See 4b57f61
    
    To speed up hub, this strips SshConfig feature set down to a bare
    minimum to keep the original functionality:
    
    - Don't record all configuration keys, just "HostName"
    - Drop support for the "key=value" assignment syntax
    - Drop support for hostname patterns, including "*" to match any value
  11. Add rake and Webmock to Gemfile

    mislav committed Dec 25, 2013
    Not sure how CI ever worked without them, but now it started failing:
    https://travis-ci.org/github/hub/builds/15945780
Commits on Dec 24, 2013
  1. Add ruby-prof to gem bundle

    mislav committed Dec 24, 2013
Commits on Dec 22, 2013
  1. Upgrade deprecated invocation in `homebrew` task

    mislav committed Dec 22, 2013
    [ci skip]
  2. v1.11.0

    mislav committed Dec 22, 2013
  3. Regenerate man page

    mislav committed Dec 22, 2013
Commits on Dec 21, 2013
  1. Merge branch 'stable-port'

    mislav committed Dec 21, 2013
  2. Clarify that curl is not being used anymore

    mislav committed Dec 21, 2013
    [ci skip]
  3. Handle quoted strings in YAML configuration

    mislav committed Dec 21, 2013
    YAML will typically output plain strings, but if they match a reserved
    keyword or are comprised of digits, they will be quoted. For
    compatibility with existing configurations, strip single quotes from all
    values read, since we only deal with string values for now.
  4. Enable cloning private repos

    mislav committed Dec 21, 2013
    Since cloning of private repos over `git:` protocol is not possible,
    users were required to manually add the `-p` flag to trigger cloning
    over the `ssh:` protocol.
    
    Now, use the GitHub API to obtain information about the repo to be
    cloned, and automatically use the `ssh:` protocol if the repo is private
    or if the current user has push access to that repo.
    
    Fixes #212, fixes #213
  5. Fix fetching the list of remotes for publishing

    mislav committed Dec 21, 2013
    It's not guaranteed that every git remote corresponds to a valid GitHub
    project.
  6. Improve detecting of origin remote and remote branch

    mislav committed Dec 21, 2013
    In hub lingo, "origin remote" is the remote pointing to the canonical
    GitHub project, i.e. where pull requests should be sent. "Remote branch"
    is where hub guesses the user has pushed their changes from the current
    local branch.
    
    The origin remote can now be called "upstream", "github", or "origin",
    in that order of precedence.
    
    The `browse`, `compare`, and especially `pull-request` commands need to
    know the remote branch. Previously we relied on git upstream
    configuration, but that wasn't enough. This behavior is now only kept if
    git "push.default" is set to "upstream" or "tracking".
    
    For "push.default" values "current", "simple" (git 2.0 default), or
    "matching" (git 1.x default), we can safely assume that the user
    probably pushes to the same-named branches on some remote, and we ignore
    upstream configuration.
    
    To find the remote where the user pushed their changes, we search for
    the same-named branch on:
    
    1. the remote which points to a GitHub project owned by the current user;
    2. "origin", "github", and "upstream" remotes.
    
    When a match is found, it is assumed that the user pushed there and it
    is taken as the implicit pull-request head.
    
    Fixes #158, fixes #360, fixes #381
  7. Deprecate converting issue to pull-request

    mislav committed Dec 21, 2013
    This feature is likely to get dropped from GitHub API in the near
    future. The alternative is to simply create a new pull-request and
    reference the original issue in the description.
  8. Remove duplicate cukes

    mislav committed Dec 21, 2013
  9. Lock down to GitHub API v3 for future compatibility

    mislav committed Dec 20, 2013
    Every API request will now declare that it wants v3 by setting
    "Accept: application/vnd.github.v3+json".
    
    http://developer.github.com/v3/media/
Commits on Dec 20, 2013
  1. Include head SHA in version info if tags are not available

    mislav committed Dec 20, 2013
    When building hub from a git repository, the detailed version
    information will get built into the executable courtesy of
    `git describe --tags`. However, if tags are not available in the
    git repo--for instance, in the case of Homebrew install from git--this
    at least embeds the current SHA in version information.
  2. Merge branch 'standalone'

    mislav committed Dec 20, 2013
  3. Avoid loading FileUtils; reimplement `mkdir_p`

    mislav committed Dec 20, 2013
    Loading FileUtils can take more than 10 ms on Ruby 2.0.0, making the
    require extremely wasteful for the purpose of just using a single method.
  4. Speed up load time by avoiding loading YAML

    mislav committed Dec 20, 2013
    Due to its sheer size, requiring YAML takes ~21 ms on Ruby 2.0.0. To
    handle hub's very simple config format, we won't need most of YAML's
    features, so we can afford to reimplement YAML just for the syntax we
    need to support the existing config format.
  5. Fix stubbing that CGI & URI modules are loaded in Ruby 2.0.0

    mislav committed Dec 20, 2013
    Simply adding e.g. "uri.rb" to $LOADED_FEATURES ($") does the job in all
    Rubies prior to 2.0.0. However, 2.0 will happily load "uri.rb" from
    stdlib when a next `require "uri"` ocurrs, seemingly ignoring the state
    of $".
    
    I have NO IDEA how immediately trying to `require` works here, but it
    does the job of preventing the actual load of "uri.rb" immediately and
    in the future as well.