diff options
| author | Russ Cox <rsc@golang.org> | 2021-01-07 12:26:06 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-01-07 18:26:46 +0000 |
| commit | 5617b8658c4ff7af5665cf0fd4bc5448d4ada7b9 (patch) | |
| tree | 4cd9e48ad8aac87b2e669024fe7605ef7d49317d /git-codereview/pending.go | |
| parent | 3f3690dc9cf1f7c0ddca72d1c5313be4022ece58 (diff) | |
| download | go-x-review-5617b8658c4ff7af5665cf0fd4bc5448d4ada7b9.tar.xz | |
git-codereview: allow work on main branches
The only reason not to allow work on branches named for the
origin branches is to preserve them for "git change main; git change new"
to make a new branch tracking main. But we can still do that and
allow commits on main - we just have to use the branchpoint
as the root of the new branch.
Now people can work on "main" (or "dev.regabi") if that suits them.
In particular, if you're doing merges, it's nice to be on "dev.regabi"
and know for sure that's the branch you're working on.
Change-Id: I8e9458793c30857a5c00e6bfd4f1cb41adbbe637
Reviewed-on: https://go-review.googlesource.com/c/review/+/279874
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'git-codereview/pending.go')
| -rw-r--r-- | git-codereview/pending.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/git-codereview/pending.go b/git-codereview/pending.go index 5808764..c1594b5 100644 --- a/git-codereview/pending.go +++ b/git-codereview/pending.go @@ -254,13 +254,6 @@ func cmdPending(args []string) { } fmt.Fprintf(&buf, "\n") printed := false - if text := b.errors(); text != "" { - fmt.Fprintf(&buf, "\tERROR: %s\n", strings.Replace(strings.TrimSpace(text), "\n", "\n\t", -1)) - if !pendingShort { - printed = true - fmt.Fprintf(&buf, "\n") - } - } if b.current && len(b.staged)+len(b.unstaged)+len(b.untracked) > 0 { printed = true @@ -419,18 +412,6 @@ func allSubmitted(work []*Commit) bool { return true } -// errors returns any errors that should be displayed -// about the state of the current branch, diagnosing common mistakes. -func (b *Branch) errors() string { - b.loadPending() - var buf bytes.Buffer - if haveGerrit() && !b.IsLocalOnly() && b.commitsAhead > 0 { - fmt.Fprintf(&buf, "Branch contains %d commit%s not on origin/%s.\n", b.commitsAhead, suffix(b.commitsAhead, "s"), b.Name) - fmt.Fprintf(&buf, "\tDo not commit directly to %s branch.\n", b.Name) - } - return buf.String() -} - // suffix returns an empty string if n == 1, s otherwise. func suffix(n int, s string) string { if n == 1 { |
