tea pr checkout: dont create local branches #314

Merged
lunny merged 8 commits from noerw/tea:checkout-use-remote-tracking-branch into master 2021-03-02 13:50:12 +00:00
Member

This avoids creation of local branches, to avoid cluttering the local repo:

  • if the commit already exists on the tip of a local branch, check that one out
  • otherwise check out the remote tracking branch (refs/remotes/<remote>/<head>), and suggest what to do if you want to make changes.

I'm not certain this behaviour is actually better, I suggest leaving this open for a while for people to try out the new behaviour:

tea pr checkout 314
make install

fixes #293

This avoids creation of local branches, to avoid cluttering the local repo: - if the commit already exists on the tip of a local branch, check that one out - otherwise check out the remote tracking branch (`refs/remotes/<remote>/<head>`), and suggest what to do if you want to make changes. I'm not certain this behaviour is actually better, I suggest leaving this open for a while for people to try out the new behaviour: ``` tea pr checkout 314 make install ``` fixes #293
noerw added the
kind
enhancement
status/needs-feedback
labels 2020-12-17 18:15:01 +00:00
noerw added 1 commit 2020-12-17 18:15:01 +00:00
dont create local branch for remotes
if matching branch exists, use it, otherwise use remote tracking branch.
this avoids cluttering the local repo too much.
All checks were successful
continuous-integration/drone/pr Build is passing
750f8fa43e
Owner

can we add a flag to let tea do, what normaly would be only suggested?
"-b to create the branch ..." ?

can we add a flag to let tea do, what normaly would be only suggested? "`-b` to create the branch ..." ?
noerw added 1 commit 2020-12-17 19:25:15 +00:00
Merge branch 'master' into checkout-use-remote-tracking-branch
All checks were successful
continuous-integration/drone/pr Build is passing
a36b36b3a8
Owner

can we add a flag to let tea do, what normaly would be only suggested?
"-b to create the branch ..." ?

I like the idea. If the -b is given, use that.

> can we add a flag to let tea do, what normaly would be only suggested? > "`-b` to create the branch ..." ? I like the idea. If the `-b` is given, use that.
noerw added 1 commit 2020-12-19 10:20:57 +00:00
Author
Member

added the --branch / -b boolean flag. providing a branch name is not supported, as then the case of using the default branch name would be quite awkward:

# this is not supported
tea pr checkout -b "foobar" 314 # checkout to localbranch "foobar"
tea pr checkout -b "" 314       # checkout to default branch name ("pulls/<idx>-<head-branch-name>")
added the `--branch` / `-b` **boolean** flag. providing a branch name is not supported, as then the case of using the default branch name would be quite awkward: ``` # this is not supported tea pr checkout -b "foobar" 314 # checkout to localbranch "foobar" tea pr checkout -b "" 314 # checkout to default branch name ("pulls/<idx>-<head-branch-name>") ```
noerw added 1 commit 2020-12-21 13:41:40 +00:00
Merge branch 'master' into checkout-use-remote-tracking-branch
All checks were successful
continuous-integration/drone/pr Build is passing
5454184f3b
6543 reviewed 2020-12-21 14:59:58 +00:00
Dismissed
@ -8,3 +8,3 @@
"fmt"
"code.gitea.io/tea/modules/config"
"code.gitea.io/tea/modules/context"
Owner

unessesary adding context into task

unessesary adding context into task
6543 marked this conversation as resolved
Owner

i thing it still should be a boolean flag not a string ...

in the case a branch with same name exist but it is not the same one it should simply fail with a meningfull error

i thing it still should be a boolean flag not a string ... in the case a branch with same name exist but it is not the same one it should simply fail with a meningfull error
noerw added 1 commit 2020-12-21 17:24:41 +00:00
Merge remote-tracking branch 'upstream/master' into checkout-use-remote-tracking-branch
All checks were successful
continuous-integration/drone/pr Build is passing
df57026ad5
6543 added 1 commit 2020-12-25 00:28:52 +00:00
Merge branch 'master' into checkout-use-remote-tracking-branch
All checks were successful
continuous-integration/drone/pr Build is passing
5cdc20fa9b
noerw added
status/needs-reviews
and removed
status/needs-feedback
labels 2021-02-27 20:03:13 +00:00
noerw added 1 commit 2021-02-28 23:35:20 +00:00
Merge branch 'master' into checkout-use-remote-tracking-branch
All checks were successful
continuous-integration/drone/pr Build is passing
1eba3345e3
noerw added 1 commit 2021-02-28 23:56:57 +00:00
code review
All checks were successful
continuous-integration/drone/pr Build is passing
2d2c6e5088
6543 approved these changes 2021-03-01 17:19:37 +00:00
Dismissed
lunny approved these changes 2021-03-02 13:50:06 +00:00
Dismissed
lunny merged commit e96cfdbbe7 into master 2021-03-02 13:50:12 +00:00
noerw deleted branch checkout-use-remote-tracking-branch 2021-03-02 13:54:02 +00:00
6543 removed the
status/needs-reviews
label 2021-03-03 16:21:54 +00:00
6543 added this to the v0.7.0 milestone 2021-03-03 16:24:50 +00:00
Sign in to join this conversation.
No description provided.