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

2790 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić 16ff60ec65 Fix alphabetical sort of `hub issue labels` output
The API result isn't guaranteed to be sorted case-insensitive, so we
perform the sort in memory before displaying.
2019-01-03 04:43:25 +01:00
Mislav Marohnić fccfb060b2 Print usage help on stdout when `--help` was requested 2019-01-03 02:26:13 +01:00
Mislav Marohnić 8373accbcc Print short usage help when running `hub pr` instead of raw markdown
Fixes #1919
2019-01-03 02:25:07 +01:00
Mislav Marohnić fab4e042fe Preserve order of hosts in hub config file
This fixes the seemingly random order of hosts in the interactive prompt
on `hub init -g`, `hub clone`, etc.
2019-01-02 18:27:50 +01:00
Mislav Marohnić 4f0bb5df67 Respect chosen Enterprise host on `hub init -g`
Fixes #1991
2019-01-02 17:11:29 +01:00
Mislav Marohnić f56701cdc9
Merge pull request #1994 from eli-schwartz/goflags
build: respect environment LDFLAGS and strip the build path
2019-01-02 17:04:53 +01:00
Mislav Marohnić dd5388fecd Support `trimpath` for Go v1.8/1.9
Go 1.10 release notes:

> The go build -asmflags, -gcflags, -gccgoflags, and -ldflags options
> now apply by default only to the packages listed directly on the
> command line. For example, go build -gcflags=-m mypkg passes the
> compiler the -m flag when building mypkg but not its dependencies. The
> new, more general form -asmflags=pattern=flags (and similarly for the
> others) applies the flags only to the packages matching the pattern.
> For example: go install -ldflags=cmd/gofmt=-X=main.version=1.2.3
> cmd/... installs all the commands matching cmd/... but only applies
> the -X option to the linker flags for cmd/gofmt. For more details, see
> go help build.
2019-01-02 17:02:12 +01:00
Mislav Marohnić d0541a127d Ensure that all external LDFLAGS are properly forwarded to `-extldflags` 2019-01-02 17:00:15 +01:00
Eli Schwartz 39e1523442 build: respect environment LDFLAGS and strip the build path
golang does not natively respect LDFLAGS, but you can pass them on the
command line using -ldflags=-extldflags=...
This is important for distributions, in order to provide common
functionality such as hardening flags.

Also strip the prefixed root source directory from the embedded source
file paths. This is not important information for the debugger, which
should only care about paths relative to $GOPATH, and results in less
build environment metadata leaking into the final binary. (This also
aids in reproducible builds when using different build directories, see
e.g. https://github.com/golang/go/issues/16860)
2019-01-02 17:00:15 +01:00
Mislav Marohnić 545badcade Have level-2 headings appear in upper-case in man pages 2019-01-02 15:11:13 +01:00
Mislav Marohnić fde295f49b Fix version string appearing in man pages 2019-01-02 15:08:43 +01:00
Mislav Marohnić fa19cebe17
Merge pull request #1992 from eli-schwartz/reproducible-timestamp
build: embed reproducible timestamp in manpages
2018-12-31 16:18:50 +01:00
Eli Schwartz 25a793a8d7
build: embed reproducible timestamp in manpages
If the environment variable SOURCE_DATE_EPOCH is set in the build
environment, prefer it over the current date when determining the
correct timestamp to use as the date the manpages were built.

See https://reproducible-builds.org/specs/source-date-epoch/
2018-12-29 19:59:02 -05:00
Mislav Marohnić ee7cdc4e23
Merge pull request #1990 from github/md2roff
Generate man pages using Go instead of Ruby
2018-12-29 16:34:27 +01:00
Mislav Marohnić 369e7d298e Tweak `hub help hub-help` formatting 2018-12-29 14:58:42 +01:00
Mislav Marohnić 10e37c3b8e Fixup test 2018-12-29 14:58:11 +01:00
Mislav Marohnić f275d483be Fix formatting in hub-release(1) 2018-12-29 14:33:12 +01:00
Mislav Marohnić 7b76308988 Add "See also" section to hub-issue(1) 2018-12-29 14:33:12 +01:00
Mislav Marohnić 70231e51b7 Restore cross-linking in HTML man pages 2018-12-29 14:33:12 +01:00
Mislav Marohnić f2603ba137 Remove Ruby ronn from build toolchain 2018-12-29 14:33:12 +01:00
Mislav Marohnić a88df6f644 Add HTML template for man pages 2018-12-29 14:33:12 +01:00
Mislav Marohnić cf02dd1118 Switch to new md2roff process in `make man-pages` 2018-12-29 14:33:12 +01:00
Mislav Marohnić c13e879d61 Render roff from Markdown 2018-12-29 10:09:04 +01:00
Mislav Marohnić 38bf3d7de4 Add Blackfriday dependency 2018-12-29 10:09:04 +01:00
Mislav Marohnić 02989309ed Docs formatting issues 2018-12-28 17:54:15 +01:00
Mislav Marohnić 9eb1a11dd3 hub 2.7.0 2018-12-28 08:07:53 +01:00
Mislav Marohnić 2a748a048d Un-deprecate converting issues to pull requests
5 years ago, in anticipation of an API change, I have made the call to
deprecate issue-to-PR conversion in hub. 4f70dd126f

Issue-to-PR conversion was wonky at those times, poorly understood, and
was generating a lot of support requests to hub's issue tracker that I
didn't want to deal with. In most cases, people tried to convert issues
that they have no rights over and they would get a cryptic validation
error in the API response.

Since then, there was a consistent plea from the hub community to keep
this feature as some teams seem to rely on this for their workflows. I
have consulted with other GitHub employees about the stableness of this
feature, and anecdotal evidence suggests that lately there haven't been
as many problems around this as there have been in the past. Also, the
GitHub API v3 will not be getting breaking changes, so it sounds like
this feature is here to stay.

Fixes #1927
Ref. #532, #410, #1806, #1770, #1628
2018-12-28 07:52:45 +01:00
Mislav Marohnić d51379494b Merge branch 'default-upstream-branch' 2018-12-28 07:22:13 +01:00
Mislav Marohnić 2b73d4faed Document how we scan git remotes and branch tracking information 2018-12-28 07:21:03 +01:00
Mislav Marohnić 8ba932b6d6
Merge pull request #1982 from apjanke/handle-printf-errors
ui Printf functions: handle errors by dying
2018-12-28 05:36:19 +01:00
Mislav Marohnić ab95e380e6 Merge branch '256color-support'
Closes #1979, fixes #1560
2018-12-28 05:32:54 +01:00
Andrew Janke dede9106c2 256-color terminal support 2018-12-28 05:31:08 +01:00
Mislav Marohnić d53b050cda
Merge pull request #1983 from apjanke/dial-deprecation
Replace deprecated Dial with DialContext
2018-12-28 04:54:46 +01:00
Mislav Marohnić c5d7cb2210 Change `MainProject()` logic to skip over non-GitHub remotes
When running `hub pull-request` with this git remote setup:
* origin:   `github.com/myuser/myfork`
* github:   `github.com/owner/repo`
* upstream: `example.com/other-repo`

this error would be shown:

    Aborted: the origin remote doesn't point to a GitHub repository.

The error is both unfortunate (the existence of "upstream" shouldn't
have aborted the whole operation) and misleading (it wasn't the "origin"
remote that was the problem).

This changes `MainProject()` so it skips over non-GitHub remotes until
it finds one that points to a GitHub project.
2018-12-28 04:16:09 +01:00
Mislav Marohnić fe603ad371 Propagate errors thrown in `loadRemotes()` 2018-12-28 03:54:14 +01:00
Mislav Marohnić 858e97c596 Encapsulate `localRepo.RemoteForProject(project)` function 2018-12-28 03:54:14 +01:00
Mislav Marohnić c375d52906 Fix detecting default `pull-request` base branch name
This changes the `MasterBranch()` implementation to consider upstream
remotes that might be named differently than "origin". The new
`DefaultBranch(remote)` function is now the preferred alternative.
2018-12-28 01:59:31 +01:00
Mislav Marohnić 31e91cdc4b
Merge pull request #1988 from github/create-unrelated-origin
Improve `hub create` dealing with an existing "origin" remote
2018-12-28 01:58:16 +01:00
Mislav Marohnić 9ac583cacf Improve `hub create` dealing with an existing "origin" remote
- No longer says "updating git remote", but not actually doing anything
- Shows a helpful warning about "origin" pointing to a possibly unrelated repo
2018-12-28 00:28:22 +01:00
Andrew Janke e89a0bce4f Replace deprecated Dial with DialContext 2018-12-22 13:03:33 -05:00
Andrew Janke 116f08f1f9 ui Printf functions: handle errors by dying 2018-12-22 12:30:38 -05:00
Mislav Marohnić cc38879bd6
Merge pull request #1976 from github/format-docs
Don't choke on literal `%` output from `--format` use
2018-12-21 09:58:19 +01:00
Mislav Marohnić f8feb335bc Don't choke on literal `%` output from `--format` use
In general, avoid using Printf without a static format string.
2018-12-20 18:01:20 +01:00
Mislav Marohnić 3e6fcc1f8a Add documentation about `%n` and `%%` tokens for `--format` 2018-12-20 17:54:49 +01:00
Mislav Marohnić de3f86fc7a
Merge pull request #1974 from apjanke/GitHub-capitalization
Capitalize GitHub in doco
2018-12-20 15:33:31 +01:00
Andrew Janke c25e478d43 Capitalize GitHub in doco 2018-12-19 21:50:44 -05:00
Mislav Marohnić ca320f401e
Merge pull request #1971 from github/cli-long-form
Clarify long-form CLI options
2018-12-19 00:31:43 +01:00
Mislav Marohnić b54179a698 Fix references to git-log(1) 2018-12-18 18:07:48 +01:00
Mislav Marohnić 97f7ea4477 Tweak docs for `hub pr list --head=BRANCH` 2018-12-18 17:53:50 +01:00
Mislav Marohnić 85d58f9c68 Clarify some other long-form CLI options 2018-12-18 17:50:38 +01:00