Commit Graph

8 Commits (b868d304348198167b7678c6980207a4abe7718f)

Author SHA1 Message Date
techknowlogick b868d30434 spdx (#581)
Co-authored-by: techknowlogick <hello@techknowlogick.com>
Co-committed-by: techknowlogick <hello@techknowlogick.com>
9 months ago
appleboy b02263adb0 refactor: improve code quality and efficiency in various files (#548)
- Replace loadConfig() with _ = loadConfig()
- Update file permissions from 0660 to 0o660
- Simplify variable declarations
- Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term
- Remove unused getCertPrincipals function
- Replace time.Now().Sub() with time.Since()
- Add test for ArgToIndex function

Signed-off-by: appleboy <appleboy.tw@gmail.com>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/548
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
1 year ago
Norwin 819cc1ab21 Add `tea clone` (#411)
Adds a new subcommand to clone repos:
```
tea clone --login try --depth 1 norwin/test
tea clone gitea/tea
tea clone noerw/tea           # will set up `master` to track `upstream` remote
tea clone try.gitea.io/noerw/test # will automatically set --login
```

This is just a replacement for `git clone` with small benefits:
- [x] does not depend on `git`, as tea ships with go-git
- [x] spares you typing of URLs and autoselects https/ssh based on your login config
- [x] forked repos: set up origin + upstream remote

Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-on: https://gitea.com/gitea/tea/pulls/411
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>
3 years ago
Norwin 808e8b1c5a Correctly match login by ssh host with port (#391)
fixes #380

note: It seems like it was expected that `SSHHost` only contains the host portion.  So this may be breaking (although I don't believe many people used the feature like that with a custom ssh port). I can't think of a good reason to *not* specify the port in that field, including the port seems more intuitive

Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/391
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>
3 years ago
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>
4 years ago
Lunny Xiao 7a10ea10df Add tea open (#101)
Fix open default to home page

Improve path join and open with no arg

add labels and milestones

Add tea open

Reviewed-on: https://gitea.com/gitea/tea/pulls/101
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
4 years ago
Lunny Xiao d4f107b710 Add Makefile / .drone.yml, use go module with vendor (#20)
* add Makefile / .drone.yml, use go module with vendor

* Update .drone.yml

Co-Authored-By: lunny <xiaolunwen@gmail.com>
5 years ago
Lunny Xiao 9d5cda4bfe
init project 6 years ago