initial imlementation of list repos (#3) #13

Closed
lunny wants to merge 11 commits from root360-AndreasUlm/list_repos into main
Owner

Author: @root360-AndreasUlm

  • implemented runRepos()
  • reimplemented issues.initCommand() as repos.initCommandLoginOnly() as repos command does not always need a valid repository argument.

Output:

$ go build && ./tea repos --login try
Name    Type/Mode       SSH-URL Owner
test-orga/test source  git@try.gitea.io:test-orga/test.git    test-user

Signed-off-by: Andreas Ulm andreas.ulm@root360.de

Author: @root360-AndreasUlm * implemented runRepos() * reimplemented issues.initCommand() as repos.initCommandLoginOnly() as repos command does not always need a valid repository argument. Output: ``` $ go build && ./tea repos --login try Name Type/Mode SSH-URL Owner test-orga/test source git@try.gitea.io:test-orga/test.git test-user ``` Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
Author
Owner

Author: @lunny

I think noheader flag seems unnecessary. We always needs a header. But for format print on console, \t will not always available.

Author: @lunny I think `noheader` flag seems unnecessary. We always needs a header. But for format print on console, `\t` will not always available.
Author
Owner

Author: @root360-AndreasUlm

I think noheader flag seems unnecessary. We always needs a header.

@lunny I just added the option to allow further output usage without requiring something like | tail -n -1 | to exclude the header.

But for format print on console, \t will not always available.

I just copied the output format from pulls.runPulls().

Author: @root360-AndreasUlm > I think `noheader` flag seems unnecessary. We always needs a header. @lunny I just added the option to allow further output usage without requiring something like `| tail -n -1 |` to exclude the header. > But for format print on console, `\t` will not always available. I just copied the output format from pulls.runPulls().
Author
Owner

Author: @root360-AndreasUlm

@lunny removed header flag and changed delimiter to pipe.

When I'm done with the unified output ( https://github.com/root360-AndreasUlm/tea/tree/unified_output_function ) the output of this function will be changed again.

Author: @root360-AndreasUlm @lunny removed header flag and changed delimiter to pipe. When I'm done with the unified output ( https://github.com/root360-AndreasUlm/tea/tree/unified_output_function ) the output of this function will be changed again.
strk reviewed 2019-05-26 15:14:38 +00:00
Dismissed
Member

Does each command have this --login switch ? Sounds like a lot of duplicated code ahead if that's the case ?

Does each command have this `--login` switch ? Sounds like a lot of duplicated code ahead if that's the case ?
lunny reviewed 2019-05-26 15:42:06 +00:00
Dismissed
Author
Owner

yes, it has. But if you are in a git repo which has a gitea remote. it could be recognized and --login could be ignored.

yes, it has. But if you are in a git repo which has a gitea remote. it could be recognized and `--login` could be ignored.
strk reviewed 2019-06-03 06:47:04 +00:00
Dismissed
Member

It would be useful to reduce duplication to centralize those switches.
BTW, I tried adding support for a -h flag (for pull-request support, see https://gitea.com/strk/tea/src/branch/pulls-create) but it failed because "-h already exists", suggesting something like "global switches" do exist.

Mind you: I could not create a pull-request for my pull-request support becuase of https://github.com/go-gitea/gitea/issues/7110 (if you want to take a look)

It would be useful to reduce duplication to centralize those switches. BTW, I tried adding support for a `-h` flag (for pull-request support, see https://gitea.com/strk/tea/src/branch/pulls-create) but it failed because "`-h` already exists", suggesting something like "global switches" do exist. Mind you: I could not create a pull-request for my `pull-request` support becuase of https://github.com/go-gitea/gitea/issues/7110 (if you want to take a look)
zeripath approved these changes 2019-06-03 08:35:40 +00:00
Dismissed
Author
Owner

I have no permission to approve this PR. :(

I have no permission to approve this PR. :(
lunny reviewed 2019-06-03 11:54:22 +00:00
Dismissed
@ -0,0 +43,4 @@
},
cli.StringFlag{
Name: "mode",
Usage: "Indicate one login, optional when inside a gitea repository",
Author
Owner

Wrong description

Wrong description
Member

I'd really look how to use global switches instead of this repeated login/password thing, btw (yes I can see the switch is not really about login)

I'd really look how to use global switches instead of this repeated login/password thing, btw (yes I can see the switch is not really about login)
@ -0,0 +47,4 @@
},
cli.StringFlag{
Name: "org",
Usage: "Indicate one login, optional when inside a gitea repository",
Author
Owner

As above

As above
@ -0,0 +51,4 @@
},
cli.StringFlag{
Name: "user",
Usage: "Indicate one login, optional when inside a gitea repository",
Author
Owner

As above

As above
lunny added the
kind
feature
label 2019-06-09 13:46:52 +00:00
lunny added this to the v0.1.0 milestone 2019-06-09 13:46:55 +00:00
Contributor

replaced by #44

replaced by https://gitea.com/gitea/tea/pulls/44
lunny closed this pull request 2019-09-14 04:47:02 +00:00
lunny deleted branch root360-AndreasUlm/list_repos 2019-09-14 04:47:16 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.