Commit Graph

28 Commits

Author SHA1 Message Date
Norwin 8bb5c15745 Add commands for reviews (#315)
add interactive `tea pr review`

it's amazingly simple

vendor gitea.com/noerw/unidiff-comments

add `tea pr lgtm|reject` shorthands

vendor slimmed down diff parser

review diff: default to true

if users want a shortcut, they can use lgtm or reject subcmds

`tea pr approve`: accept optional comment

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/315
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-21 23:22:22 +08:00
Norwin 43a58bdba1 Proper help text & new README structure (#311)
add cli.AppHelpTemplate for customization

customize tea help view

tea --version : improve parseability

Rework README to include tea help output

It's an antipattern to have different help texts aimed at the same
users. So now that we have a good cli help text, lets use it here.
This eases maintenance, and at the same time gives an honest impression
on what we have to offer, while also encouraging to improve the internal
help text in the future.

I feel a bit sad for the GIF, but it was becoming outdated anyway..

group commands by category

add new demo gif

shows the (probably) most useful workflow

readme improvement

Merge branch 'master' into improve-app-help

code review

Merge branch 'master' into improve-app-help

restructure installation section

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/311
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-21 21:37:20 +08:00
Martin Reboredo a2e8b47c57 Implement PR closing and reopening (#304)
Implement pull request closing/reopening

Signed-off-by: Martin Reboredo <yakoyoku@gmail.com>

Correct year and `pull` description

Apply changes from #291

Return fmt.Errorf instead of log.Fatal if no pull index was supplied

Co-authored-by: Martin Reboredo <yakoyoku@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/304
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: appleboy <appleboy.tw@gmail.com>
Co-Authored-By: Martin Reboredo <yakoyakoyokuyoku@noreply.gitea.io>
Co-Committed-By: Martin Reboredo <yakoyakoyokuyoku@noreply.gitea.io>
2020-12-17 06:47:12 +08:00
Norwin 83b73ce78e Show PR CI status (#306)
fix layout of pr reviews

show PR CI status

put conflict info in status list

remove line

show merged state

deduplicate reviews by user

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/306
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-17 01:16:50 +08:00
Norwin dc67630b64 replace flag globals, require context for commands (#291)
introduce TeaContext

clean up InitCommand

move GetListOptions to TeaContext

ensure context for each command

so we fail early with a good error message instead of "Error: 404" etc

make linter happy

Merge branch 'master' into refactor-global-flags

move TeaContext & InitCommand to modules/context

Merge branch 'master' into refactor-global-flags

CI.restart()

Merge branch 'master' into refactor-global-flags

Merge branch 'master' into refactor-global-flags

Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/291
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-16 01:38:22 +08:00
6543 2b11f408fd Pull DetailView: Show more pull informations (#271)
Pull Detailview: add head/base-branch, reviews, mergable info

print info if reviews can not be loaded

No Conflicts

Reviewed-on: https://gitea.com/gitea/tea/pulls/271
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: 6543 <6543@obermui.de>
Co-Committed-By: 6543 <6543@obermui.de>
2020-12-08 12:06:05 +08:00
Norwin 3bfae84d32 Use Print Package (#214)
print issue & URL after issue creation & edit

use print package for pull detail

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/214
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-10-02 14:15:18 +00:00
6543 f445ac7521 Refactor: apply new internal structurs (#206)
fix lint

fix lint

Move print TrackedTimesList to print package

Move AbsPathWithExpansion to utils/path.go

rename module intern to config

Move Subcomands into it's own Packages

Split times subcomands into own sourcefiles

Split repos subcomands into own sourcefiles

Split releases subcomands into own sourcefiles

Split pulls subcomands into own sourcefiles

Split milestones subcomands into own sourcefiles

Split login subcomands into own sourcefiles

Split labels subcomands into own sourcefiles

split issues subcomands into own sourcefiles

mv

Move Interactive Login Creation to interact package

Move Add Login function to intern/login.go

apply from review

lint: add description to exported func

smal nits

Move DetailViews stdout print func to print package

Refactor:
* Move Config & Login routines into intern package
* rename global var in cmd
* Move help func to utils

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/206
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-30 05:11:33 +00:00
6543 9602c149ca Changelog v0.5.0 (#205)
Add Changelog for v0.5.0

Update SubComand Descriptions

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/205
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-27 14:35:53 +00:00
Norwin 887495f38f Fix Pulls Create (#202)
small refactor

fix TrimLeft bug, improve logging

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/202
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-09-26 18:43:57 +00:00
Norwin 159bf03d49 tea pulls create: detect head branch repo owner (#193)
dont print on already pushed branch

more consisten error handling

detect repo owner for default head branch

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/193
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-24 10:44:03 +00:00
6543 3652f1dcb2 Issues/Pulls: Details show State (#196)
Pull: Render output & add State to issues

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/196
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
2020-09-23 10:30:29 +00:00
Norwin d7f429d246 make issues & pulls subcommands consistent (#188)
Merge branch 'master' into pr-details

make issues & pulls subcommands consistent

- by default list open items
- show detail when argument is provided
- expose listing as ls subcommand
- accept --state flag on command and ls subcommand

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/188
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-21 05:03:20 +00:00
6543 7c30579900 Add milestones subcomand (#149)
issues/pulls show milestones

add mile issues subsubcomand

Add milestones subcomand

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/149
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-09-17 19:35:24 +00:00
6543 f47ac8f96e Update SDK to v0.13.0 (#179)
check err

Notifications: Add Pinned Filter

migrate & adapt

update sdk to v0.13.0

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/179
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-16 02:01:41 +00:00
6543 f1801f39a6 Add subcomand 'pulls create' (#144)
wordings

print pull URL

change title required mesage

inform User on push error

fix body

🚀

finish

impruve

fix help menue of pull create

refactor

Add pull-request command

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Sandro Santilli <strk@kbt.io>
Reviewed-on: https://gitea.com/gitea/tea/pulls/144
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
2020-07-16 15:00:51 +00:00
6543 59fe58577a Migrate gitea-sdk to v0.12.0 (#133)
Migrate

Update code.gitea.io/sdk/gitea to v0.12.0.

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/133
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-27 13:48:09 +00:00
6543 6cff3b1cc7 migrate src-d/go-git -> go-git/go-git (#128)
Merge branch 'master' into vendor-migrate-go-git

Merge branch 'master' into vendor-migrate-go-git

migrate src-d/go-git -> go-git/go-git

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/128
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-04-30 02:02:15 +00:00
Norwin 4cda7e0299 add `tea pulls [checkout | clean]` commands (#93 #97 #107) (#105)
Merge branch 'master' into issue-97/pulls-clean

vendor terminal dependency

pull/push: provide authentication method

automatically select an AuthMethod according to the
remote url type. If required, credentials are prompted for

login: store username & optional keyfile

refactor

refactor GetRemote

Merge branch 'master' into issue-97/pulls-clean

adress code review

add --ignore-sha flag

When set, the local branch is not matched against the remote sha,
but the remote branch name. This makes the command more flexible
with diverging branches.

add missing error check

fix branch-not-found case

Merge branch 'master' into issue-97/pulls-clean

use directory namespaces for branches & remotes

fix TeaCreateBranch()

improve method of TeaFindBranch()

now only checking .git/refs instead of looking up .git/config which may
not list the branch

add `tea pulls clean`

fixes #97

add copyright to new files

make linter happy

refactor: use new git functions for old code

add `tea pulls checkout`

Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/105
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-04-19 03:09:03 +00:00
Norwin f5d0790619 Add --state flag filter to issue & PR lists (#100)
Add --state flag filter to issue & PR lists

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/100
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: 6543 <6543@noreply.gitea.io>
2020-03-29 13:16:06 +00:00
appleboy c20d7d45aa chore(cli): upgrade urfave/cli to v2 version (#85)
chore(cli): upgrade urfave/cli to v2 version

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-01-04 17:44:25 +00:00
serverwentdown 72b602409b Minor improvements to command-line language (#66) 2019-11-03 20:34:41 +00:00
Norwin cd1ddb86b5 fix -o flag (#53) 2019-10-26 14:25:54 +00:00
root360-AndreasUlm 7df0354d6c added global appendable Flags (#12) (#39) 2019-10-23 15:58:18 +00:00
root360-AndreasUlm 7c024bcd69 unified output (#14) (#40) 2019-09-15 08:38:18 +00:00
Andreas Ulm 3713949934 skip empty pull requests (#17) (#18)
Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2019-04-23 19:13:39 +03:00
Lunny Xiao 247a43691b
fix comments and descriptions 2019-03-12 09:36:14 +08:00
Lunny Xiao 9d5cda4bfe
init project 2018-09-03 14:43:00 +08:00