1
0
mirror of https://gitea.com/gitea/tea.git synced 2024-06-16 06:25:25 +00:00
Commit Graph

5 Commits

Author SHA1 Message Date
techknowlogick
b868d30434 spdx (#581)
Co-authored-by: techknowlogick <hello@techknowlogick.com>
Co-committed-by: techknowlogick <hello@techknowlogick.com>
2023-09-08 01:40:02 +00:00
Norwin
78a95f1ca4 Allow editing multiline prompts with external text editor (#429)
- Adds a new `Preferences` struct to the config, initially only containing `Editor: bool (default false)`.
  This struct will be serialized to configs once there is a first tea induced change to the config (eg `tea login default <name>` or `tea login add`).
- Use external editor for all multiline prompts if preferred.

We already had a function for starting a texteditor for diff reviews; it does not really make sense to replace it with `survey.Editor`, as there is a big interface mismatch: survey expects strings as inputs, while our diff functions operate on files,

fixes #424

Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/429
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-10-14 22:36:08 +08:00
Norwin
802bdf7dc5 Don't require a body for comment PR reviews (#399)
fixes #372

Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/399
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-09-23 02:18:25 +08:00
plgruener
3129e60a73 text editor selection: follow unix defacto standards (#356)
Currently, `tea` only supports the $EDITOR env var to open the user's preferred editor (used for reviewing pull requests).

Standard \*nix practice is, however, to check for $VISUAL first and only then use $EDITOR as fallback.
This is also done by Git itself, see man git-var(1).
(Actually, the order there is $GIT_EDITOR > core.editor > $VISUAL > $EDITOR > vi)

Co-authored-by: plgruener <pl.gruener@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/356
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: plgruener <plgruener@noreply.gitea.io>
Co-committed-by: plgruener <plgruener@noreply.gitea.io>
2021-06-21 20:08:27 +08:00
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