Commit graph

182 commits

Author SHA1 Message Date
camille folch
568f4e4ee0
Minor refactoring for readability in NewCmdFork's runE 2021-06-11 23:28:41 -03:00
camille folch
54b86c7093
repo fork: check that --org is not the empty string
As it is already being done for --remote-name, except in this case
the default is the empty string.
2021-06-11 23:28:41 -03:00
Nate Smith
b0998772ae more cleanup 2021-06-10 21:46:02 +00:00
Nate Smith
f31a31e2ed stop stubbing out a Since function 2021-06-10 21:46:02 +00:00
vilmibm
4a7ec7f4f6 cleaning up fork tests 2021-06-10 21:45:54 +00:00
vilmibm
14de70a011 add defaultRemoteName 2021-06-10 21:44:49 +00:00
Mislav Marohnić
4b0b422eb5
Add --json export functionality to repo commands (#3627) 2021-05-17 16:53:20 +02:00
Mislav Marohnić
3f3d4e38d4 Avoid crash when --json doesn't request nameWithOwner 2021-05-17 16:43:39 +02:00
Mislav Marohnić
a2307e357d Add repo list --json support 2021-05-17 16:32:01 +02:00
Mislav Marohnić
02a2ed2f73 Add repo view --json export functionality 2021-05-12 17:05:15 +02:00
Mislav Marohnić
3cbd5b4934
Add repo fork --org functionality (#3611)
Co-authored-by: Gowtham Munukutla <gowtham.m81197@gmail.com>
2021-05-10 17:09:03 +02:00
Sam Coe
01505daaf5
remove previous emoji workaround 2021-04-12 09:56:00 -07:00
Gowtham Munukutla
5caf01c564 add test for non tty fork 2021-04-01 10:49:12 +05:30
Gowtham Munukutla
745b3fec17 fix premature return while forking repo non interactively 2021-03-31 20:20:07 +05:30
Mislav Marohnić
44ae7ae3cf
Merge pull request #3279 from cli/browser-refactor
Pass web browser to each individual command
2021-03-30 16:54:59 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
179d3f0249 Add a unified GitHub Search query builder 2021-03-23 18:52:58 +01:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
2021-03-19 21:22:37 +01:00
Nate Smith
2ab073d599
Refactor use of glamour to allow style overrides (#3243)
* Refactor use of glamour to allow style overrides

* leave the things the way they were and just expose the ability to set overrides
2021-03-19 16:29:32 +00: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ć
9e63199a65 Add tests for checking out repository after creating from template 2021-03-01 14:12:56 +01: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
Mislav Marohnić
e27a77fc99 Add ability to filter by archived in repo list
Like `--language`, archived filters also use the Search API.
2021-02-27 17:20:06 +01:00
Mislav Marohnić
5da8301d5d Enable filtering repo list by coding language 2021-02-27 16:52:47 +01:00
Mislav Marohnić
f75144dd1f Enable pager for repo list output 2021-02-27 15:05:11 +01:00
Mislav Marohnić
2bdffc85e2 Isolate flag processing tests in repo list 2021-02-27 14:39:06 +01:00
Mislav Marohnić
1fa763f514 Avoid having to first query for username in repo list
Dynamically construct the GraphQL query by using the `viewer` connection
if the owner isn't set and the `repositoryOwner(login:"...")` connection
if the owner was set.
2021-02-27 14:38:56 +01:00
Mislav Marohnić
4da02614ed Switch repo list to query via graphql package
Also order results by PUSHED_AT instead of UPDATED_AT to match the web
interface.
2021-02-27 13:17:59 +01:00
Cristian Dominguez
2284ef43d0 repo list: add tests 2021-02-19 17:34:17 -03:00
Cristian Dominguez
cad875a05f repo list: render repo tags into the 3rd column instead of the 2nd 2021-02-18 19:02:59 -03:00
Cristian Dominguez
b7c2865d0f Remove archived filter from repo list 2021-02-18 17:34:00 -03:00
Mislav Marohnić
e596f8732b Fix creating a repository from template
Fixes a problem where setting up a new local directory for the
repository created from a template would not contain any files:

    gh repo create -p OWNER/some-template my-repo --private --confirm
    ls my-repo
    //=> [empty directory]

Fixes #2290
2021-02-17 20:26:06 +01:00
Mislav Marohnić
a8fdd9a303 Further clarify what will happen on repo create
In local git directory:
1. `This will add an "origin" git remote to your local repository.  Continue?`
2. "origin" git remote is added in current directory.

Outside of a local git directory:
1. This will create the "REPO" repository on GitHub. Continue?
2. `Create a local project directory for "REPO"?`
3. new directory called "REPO" now set up for the GitHub repository.
2021-02-17 20:22:23 +01:00
Nate Smith
e91b97b4c5
fully restore fork remote renaming behavior (#2982)
* fully restore fork remote renaming behavior

* catch blank remote name and error + arg tests

* hard wrap fork usage

* do not rename if remote-name supplied

* tweak error text
2021-02-17 12:33:22 -06:00
ulwlu
95a8f926ab
Remove unnecessary Sprint 2021-02-13 18:10:38 +09:00
ulwlu
16be90c538
Fix unnecessary Sprintf with Sprint 2021-02-13 17:20:39 +09:00
ulwlu
e461baa217
Fix prompt string when creating remote repository
If you are in git project not pushed to remote yet,
prompt says 'This will create {reponame} in current directory. Continue?',
however, it doesn't create while it only adds remote origin.

I was going to create PR to avoid creating new directory before I knew
this behavior.
This behavior is already ideal, so I changed prompt not to scare users
like I got scared.
2021-02-13 17:11:08 +09:00
Cristian Dominguez
9a149d7694 Add repo list command 2021-02-11 19:44:47 -03:00
Mislav Marohnić
ab21dbeaf0 Improve repo create docs
- Clarify what will happen when in the git directory vs. out;
- List requirements for non-interactive use;
- Demonstrate how to turn issues/wiki off.
- Misc. formatting tweaks
2021-02-03 22:05:06 +01:00
Devon Romanko
2964895a77 fix test behavior changes from migration to run.Stub 2021-01-27 18:46:29 -05:00
Devon Romanko
696cbfc8d1 use Stub instead of SetPrepareCmd in 'repo create' tests 2021-01-27 07:59:32 -05:00
Nate Smith
6152d8a419
Merge pull request #2825 from cli/rename-fork
restore fork rename behavior for nontty case
2021-01-25 11:29:52 -08:00
vilmibm
26f6761481 add note about future behavior 2021-01-25 11:29:26 -08:00
Mislav Marohnić
f46bab256c Rename to SuccessIconWithColor 2021-01-25 14:56:39 +01:00
vilmibm
d051f0634f update tests 2021-01-22 16:13:39 -08:00
vilmibm
1fa3047b59 restore renaming behavior for nontty case 2021-01-22 16:12:25 -08:00
Mislav Marohnić
96fa6e7830 Merge remote-tracking branch 'origin' into success-icon-consistency 2021-01-22 23:56:54 +01:00
Mislav Marohnić
23d68705bc Match color of the success icon with the end state of the record 2021-01-22 23:55:33 +01:00
Mislav Marohnić
06cf2c9f81 Merge remote-tracking branch 'origin' into cmd-stub-new 2021-01-22 16:31:29 +01:00
Nate Smith
29805a4003
Merge pull request #2588 from cdce8p/gh-clone-fetch
Only fetch default branch when adding upstream remote
2021-01-21 12:57:10 -08:00