Commit graph

3302 commits

Author SHA1 Message Date
Gowtham Munukutla
1d8dd2f1e9 add tests for additions and deletions 2021-03-06 15:02:16 +05:30
Gowtham Munukutla
f2489ed22f reduce arg length to fprintf 2021-03-05 14:05:41 +05:30
Gowtham Munukutla
bdd663e658 Add additions and deletions in pr view raw as well 2021-03-05 13:41:25 +05:30
Gowtham Munukutla
9944698665 Add additions and deletions in pr view 2021-03-05 11:20:49 +05:30
Nate Smith
2fbc037658
Merge pull request #3042 from g14a/bug/gist-binary-files
Remove functionality to add, view and edit binary files in gists
2021-03-04 13:01:54 -06:00
Mislav Marohnić
6b483aa468
Merge pull request #3083 from cli/update-notice-redirect
Avoid checking for new releases when authenticating git
2021-03-04 17:52:09 +01:00
Mislav Marohnić
dbf1145cc0
Merge pull request #3012 from cli/api-jq
Add `--filter` to api command to filter data using jq syntax
2021-03-04 17:47:03 +01:00
Mislav Marohnić
0aebfacd95
Merge pull request #3011 from cli/api-template
Add a template `--format` flag to api command
2021-03-04 17:46:49 +01:00
Mislav Marohnić
c63247f0ea Avoid checking for new releases when authenticating git
Avoid displaying upgrade notice if any output is redirected. This also
alleviates the need to specifically check for `gh completion -s
<shell>`, `gh __complete`, and other scripting scenarios where we
absolutely don't want to trigger any upgrade checks or notices.
2021-03-04 17:39:25 +01:00
Mislav Marohnić
4e24f36495 Declare --jq, --template, --silent options mutually exclusive 2021-03-04 17:29:59 +01:00
Mislav Marohnić
d89756c94c Add test for api --jq 2021-03-04 17:10:48 +01:00
Mislav Marohnić
06eeea0737 Change the api --filter flag to api --jq 2021-03-04 17:05:31 +01:00
Mislav Marohnić
4c26d617d3 Merge remote-tracking branch 'origin/api-template' into api-jq 2021-03-04 17:00:41 +01:00
Mislav Marohnić
eb08774370 Assert that executeTemplate is invoked 2021-03-04 16:48:06 +01:00
Mislav Marohnić
f53ad7161a Add more api --template tests 2021-03-04 16:35:08 +01:00
Mislav Marohnić
0f27084f57 Add flag parsing test for api --template 2021-03-04 15:01:59 +01:00
Mislav Marohnić
07cb5e9e17 Merge remote-tracking branch 'origin' into api-template 2021-03-04 14:53:08 +01:00
Mislav Marohnić
aa5cf6c48a
Merge pull request #3075 from cli/credential-helper-absolute
Use absolute path when configuring gh as git credential
2021-03-04 13:51:24 +01:00
Mislav Marohnić
e96d974331
Merge pull request #3023 from cli/cancel-error-status
Issue/pr create: exit with nonzero status code when "Cancel" was chosen
2021-03-04 13:45:11 +01:00
Mislav Marohnić
cfbfb578f0 Read Executable from factory instead of from stdlib 2021-03-04 13:41:50 +01:00
Mislav Marohnić
9234163679 Formalize gh process exit codes
Here are the statuses:
- 0: success
- 1: misc. error
- 2: user interrupt/cancellation
- 4: authentication needed

These old exit codes are now changed to "1":
- we used to return "2" for config file errors;
- we used to return "2" for alias expansion errors;
- we used to return "3" for alias runtime errors.

I do not believe that there is a need to distinguish these specific
cases via exit status, and converting them to "1" frees codes "2" and
"3" for more practical use.
2021-03-04 13:35:59 +01:00
Mislav Marohnić
1eefb6bbc0
Merge pull request #3077 from cli/api-preview
Add the `api --preview` flag to opt into GitHub API previews
2021-03-04 12:39:46 +01:00
Mislav Marohnić
440b59f8c3 Add the api --preview flag to opt into GitHub API previews
This was previously available manually via the `-H` flag, but it was
verbose, especially when opting into multiple previews.
2021-03-03 20:12:51 +01:00
Mislav Marohnić
03baeb2645 Add documentation and tests for api --filter 2021-03-03 19:24:38 +01:00
Mislav Marohnić
9f4eb55b66 Merge remote-tracking branch 'origin/api-template' into api-jq 2021-03-03 17:35:18 +01:00
Mislav Marohnić
98f1f5ec0d Use absolute path when configuring gh as git credential
This keeps git operations working even when PATH is modified, e.g. `brew
update` will work even though Homebrew runs the command explicitly
without `/usr/local/bin` in PATH.

Additionally, this inserts a blank value for `credential.*.helper` to
instruct git to ignore previously configured credential helpers, i.e.
those that might have been set up in system configuration files. We do
this because otherwise, git will store the credential obtained from gh
in every other credential helper in the chain, which we want to avoid.

Before:

    git config --global credential.https://github.com.helper '!gh auth git-credential'

After:

    git config --global credential.https://github.com.helper ''
    git config --global --add credential.https://github.com.helper '!/path/to/gh auth git-credential'
2021-03-03 16:20:21 +01:00
Mislav Marohnić
bf97c6e273 Add template functions, documentation, tests 2021-03-02 20:07:04 +01:00
Mislav Marohnić
ed219ab5f3 Merge remote-tracking branch 'origin' into api-template 2021-03-02 18:31:28 +01:00
Mislav Marohnić
3444d00bee
Merge pull request #3018 from castaneai/pr-create-body-file
Add `pr create --body-file` flag
2021-03-02 15:21:17 +01:00
Mislav Marohnić
07e6d60c80
Merge pull request #2991 from cli/repo-create-prompt-change
Repo create tweaks
2021-03-02 15:14:16 +01:00
Mislav Marohnić
f93674bc76
Merge pull request #3059 from fossdd/patch-1
Add information about AUR
2021-03-02 15:06:53 +01:00
Mislav Marohnić
331bf50076
Tweak language 2021-03-02 15:05:16 +01:00
Mislav Marohnić
e16c3124dd Disallow binary files with gist edit -a 2021-03-02 14:58:16 +01:00
Mislav Marohnić
066ba54549 Sort gist files case-insensitively 2021-03-02 14:53:19 +01:00
Mislav Marohnić
77d9051d0e Simplify looking up binary types in gist 2021-03-02 14:53:10 +01:00
Gowtham Munukutla
973fbb0925 Disallow operating on binary files in gist 2021-03-02 14:52:44 +01:00
Mislav Marohnić
dd34cae112 Merge remote-tracking branch 'origin' into cancel-error-status 2021-03-02 13:52:07 +01:00
Mislav Marohnić
2ebdde1ddd Exit with status code "2" on user cancellation errors
This also stops printing "interrupt" after Ctrl-C is pressed.
2021-03-02 13:48:44 +01:00
Mislav Marohnić
50c49df41a
Merge pull request #3010 from cli/api-cache
Add `api --cache` flag
2021-03-02 12:47:03 +01:00
Nate Smith
953855c1c3
Merge pull request #3008 from ganboonhong/interactive-gist-view
Add interactive select in gist view
2021-03-01 16:10:05 -06:00
vilmibm
39718cd5ca just hide empty descriptions 2021-03-01 16:07:04 -06:00
vilmibm
00e8c07021 Merge remote-tracking branch 'origin/trunk' into interactive-gist-view 2021-03-01 16:05:26 -06:00
vilmibm
e100b15acb some text tweaks 2021-03-01 16:03:48 -06:00
fossdd
14c4743f8c
Fix markdown link
Co-authored-by: Nate Smith <vilmibm@github.com>
2021-03-01 19:01:18 +00:00
Mislav Marohnić
69b9aa3a57 Merge remote-tracking branch 'origin' into api-cache 2021-03-01 16:06:17 +01:00
Mislav Marohnić
162a1b290a Allow caching HTTP 204 responses 2021-03-01 16:04:34 +01:00
Mislav Marohnić
e32e6406a7 Add test for api --cache behavior 2021-03-01 16:04:19 +01:00
Mislav Marohnić
9e63199a65 Add tests for checking out repository after creating from template 2021-03-01 14:12:56 +01:00
fossdd
a6e9940b81
Add information about AUR
The AUR is a community-based location for PKGBUILDs, Arch's Install scripts.

There is a unofficial PKGBUILD for building and installing `gh` from the git repo.

https://aur.archlinux.org/packages/github-cli-git
2021-02-28 12:54:19 +00:00
Mislav Marohnić
00cb921cd5
Merge pull request #2953 from cristiand391/add-repo-list
Add `repo list` command
2021-02-27 17:34:32 +01:00