Commit graph

1083 commits

Author SHA1 Message Date
Mislav Marohnić
c3923785da
Merge pull request #730 from cli/installation-link
Bring back `#installation` anchor in README
2020-04-03 16:34:56 +02:00
Mislav Marohnić
8bea97810f
Merge pull request #744 from rainersigwald/patch-1
Clarify error in powershell completion test
2020-04-03 14:31:40 +02:00
Rainer Sigwald
ad7b4b0130
Clarify error in powershell completion test 2020-04-03 07:18:19 -05:00
Mislav Marohnić
f5aa2bb5ac
Bring back #installation anchor in README
This is linked to from GitHub.com call-to-action to install CLI
2020-04-02 12:52:01 +02:00
Mislav Marohnić
e066e98a9a
Merge pull request #726 from cli/pr-create-crash
Fix auto-forking scenario in `pr create`
2020-04-01 19:46:39 +02:00
Mislav Marohnić
f0e6c98bf0 Fix auto-forking scenario in pr create
When an existing `headRepo` couldn't be detected, it's time to auto-fork
one. Unfortunately, an obscure Go behavior made it seem like `headRepo`
was a non-nil value, where in fact it did contain a nil pointer which
would crash the process.

This avoids ever assigning nil pointers to `var headRepo ghrepo.Interface`.
2020-04-01 19:37:56 +02:00
Nate Smith
44a37cbba3
Merge pull request #723 from cli/go-ci-checks
Assert that running `go fmt` or `go mod tidy` produces no changes in CI
2020-04-01 10:58:14 -05:00
Mislav Marohnić
ad190519c6 Simplify ANSI coloring 2020-04-01 15:09:24 +02:00
Mislav Marohnić
228312a30d Have git diff produce colored output in CI 2020-04-01 14:48:47 +02:00
Mislav Marohnić
7dbc5e99e4 go: download dependencies before running tests in CI 2020-04-01 14:48:43 +02:00
Mislav Marohnić
a8894a0745 Assert that running go fmt or go mod tidy produces no changes in CI
This will help avoid introducing code changes that are not properly
formatted, or `go mod` dependency changes that are untidy.

Ref. 0680bb5c6c
2020-04-01 14:30:52 +02:00
vilmibm
0680bb5c6c go mod tidy 2020-03-31 14:47:27 -05:00
Nate Smith
742a194b7e
Merge pull request #720 from cli/fork-rename-remotes
Add "upstream" remote after `repo fork`
2020-03-31 13:47:30 -05:00
Mislav Marohnić
fa3d65b2b6 Add "upstream" remote after repo fork 2020-03-31 18:36:41 +02:00
Mislav Marohnić
0e9b48d876
Merge pull request #719 from cli/upstream-remote
Automatically set up "upstream" remote for forks
2020-03-31 17:10:50 +02:00
Mislav Marohnić
e0ba3fd614
Merge pull request #717 from cli/improve-finding-commits
Use remote tracking branch for base when detecting commits for `pr create`
2020-03-31 17:08:10 +02:00
Mislav Marohnić
8460609181 repo clone: automatically set up "upstream" remote for forks 2020-03-31 15:32:52 +02:00
Mislav Marohnić
219e3ecc5b Stop querying base branch commit hash from API
This code was put in place in preparation for a feature that never
shipped. Namely, we wanted to use the commit hash for the base branch so
we can get an accurate `git log` involving the changes in a pull
request. However, getting the commit hash from API is not the way to go
because the latest commit might not be available in the person's local
repository, and using a local tracking branch for base such as
`origin/master` works quite well in most cases without dereferencing it.
2020-03-31 13:36:48 +02:00
Mislav Marohnić
24a332bb1b Use remote tracking branch for base when detecting commits for pr create
This is to avoid errors when a local base branch is missing or out of
date.
2020-03-31 13:32:44 +02:00
Nate Smith
7555a4cf2f
Merge pull request #696 from cli/pr-status-no-commits
fix branch detection on empty repo
2020-03-30 12:08:14 -05:00
vilmibm
c966f0dca5 test fallout 2020-03-30 12:04:45 -05:00
vilmibm
44acdd4ec3 Merge branch 'master' into pr-status-no-commits 2020-03-30 12:04:02 -05:00
Mislav Marohnić
1fb0eefd36
Merge pull request #680 from cli/pr-create-push-default
Creating a PR now always prioritizes an existing fork as a push target
2020-03-30 13:38:11 +02:00
Mislav Marohnić
da2116f8ee Merge remote-tracking branch 'origin/master' into pr-create-push-default 2020-03-30 13:32:37 +02:00
Mislav Marohnić
04324191fe
Merge pull request #704 from cli/branch-push-detection
Avoid auto-forking/pushing an already pushed branch in `pr create`
2020-03-30 13:28:49 +02:00
Mislav Marohnić
c7b0abd849
Merge pull request #708 from cli/detect-existing-fork
repo fork: reuse existing git remote if available
2020-03-30 12:06:27 +02:00
Mislav Marohnić
265db26b78 Merge remote-tracking branch 'origin/master' into detect-existing-fork 2020-03-30 12:02:33 +02:00
Mislav Marohnić
988d36deb4
Merge pull request #709 from cli/www-hostname-support
Support `www.github.com` git remote URLs
2020-03-30 11:57:52 +02:00
Mislav Marohnić
d4692c3ad9
Merge pull request #707 from cli/stale-check-conclusion
Prevent crash when encountering "STALE" check conclusion
2020-03-30 10:29:01 +02:00
vilmibm
eb403a3b1e more nuanced error typing 2020-03-27 11:35:39 -05:00
Mislav Marohnić
894899c71d Add code docs for ghrepo package 2020-03-27 14:01:44 +01:00
Mislav Marohnić
303f60815f Support www.github.com git remote URLs 2020-03-27 14:01:44 +01:00
Mislav Marohnić
c17251d106 Add table-driven test for repoFromURL 2020-03-27 14:01:44 +01:00
Mislav Marohnić
965f2704f3 repo fork: reuse existing git remote
Avoid adding a new git remote for a fork if an existing remote is found
that points to the exact forked repo.
2020-03-27 13:30:25 +01:00
Mislav Marohnić
0f98d56649 Rename underscored variable to camelcase 2020-03-27 13:30:25 +01:00
Mislav Marohnić
a6335396cf repo fork: simplify printing the name of an existing forked repo 2020-03-27 13:30:25 +01:00
Mislav Marohnić
c0bc938ea4 Prevent crash when encountering "STALE" check conclusion
The "STALE" conclusion has shipped this January and is basically a
conclusion that can only be reported by GitHub and not explicitly set by
any integrations.
2020-03-27 09:54:11 +01:00
vilmibm
ca99096ca8 use CmdError in StubError and fix git_test 2020-03-26 15:32:31 -05:00
vilmibm
0af232444c consolidate into one symbolic-ref call 2020-03-26 15:00:58 -05:00
Mislav Marohnić
cba8331d55 Avoid auto-forking/pushing an already pushed branch in pr create
A branch is considered already pushed if its HEAD commit hash matches
the commit hash of one of the remote tracking branches:
`refs/remotes/<remote>/<branch>`

This mechanism allows the user to:

- Choose a remote as push target for their branch different than the one
  that would automatically get chosen for them by `pr create`;

- Avoid a `git push` operation (and its associated git hooks) if a push
  was not necessary in the first place.
2020-03-26 20:35:42 +01:00
Mislav Marohnić
3907914225 Guard against filesystem paths in git.ReadBranchConfig
A valid remote specificication read from `branch.<name>.remote` git
config can be a URL, a `.`, a filesystem path, and a remote name. When
detecting the remote name, be sure not to take filesystem paths instead.
2020-03-26 19:23:17 +01:00
Mislav Marohnić
c36b84e550 Convert git.VerifyRef into a more versatile ShowRefs
This is so we can pass a list of full qualified refs and have them
resolved for both existence and their commit hashes.
2020-03-26 19:21:40 +01:00
Mislav Marohnić
beb0a6a322
Merge pull request #683 from cli/pr-status-unicode
Add unicode to pr status
2020-03-26 13:30:26 +01:00
vilmibm
dd877b6a34 merge fallout 2020-03-25 12:01:44 -05:00
vilmibm
f4b8851011 Merge remote-tracking branch 'origin/master' into pr-status-no-commits 2020-03-25 12:00:58 -05:00
vilmibm
897d5c3dca fall back to symbolic-ref in CurrentBranch 2020-03-25 11:57:53 -05:00
Nate Smith
e4b8ae0ec4
Merge pull request #665 from cli/preview-default
switch {pr,issue} view default
2020-03-25 11:32:46 -05:00
Nate Smith
26022bc684
Merge pull request #690 from cli/repo-view-terminal
Add ability to view repo in terminal and do it by default
2020-03-25 11:32:26 -05:00
vilmibm
a8a57595dc explicitly ignore readme fetching error 2020-03-25 11:26:58 -05:00
Mislav Marohnić
88cbcc9ec5 Merge remote-tracking branch 'origin/master' into pr-status-unicode 2020-03-25 09:06:27 +01:00