aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/change_test.go
AgeCommit message (Collapse)Author
2023-07-27git-codereview: allow _content to not warnv1.5.0Sean Liao
Fixes golang/go#45734 Change-Id: I20ebc9fb728c5e91a3d71d3a6290ccf27ceb14cf Reviewed-on: https://go-review.googlesource.com/c/review/+/496775 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-29git-codereview: add -s option for changePaul Jolly
Some projects (CUE, https://cuelang.org, is one such example) use the Developer Certificate of Origin (https://developercertificate.org) as an alternative to a CLA. For such projects, all commit messages must contain the Signed-off-by trailer, with an email address that matches the commit author. This requires the -s flag to be passed to git commit. This change adds a -s flag to git-codereview's change command, which is then simply passed through to git commit. Change-Id: I6aeac37a1bcdc6e260ae822d3a03117fb87f846f Reviewed-on: https://go-review.googlesource.com/c/review/+/334750 Trust: Paul Jolly <paul@myitcv.org.uk> Run-TryBot: Paul Jolly <paul@myitcv.org.uk> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2021-01-07git-codereview: make git change handle GitHub PRsRuss Cox
Change-Id: Iab0417d14a29dce1a43f30f1f357d3f71dfdb51f Reviewed-on: https://go-review.googlesource.com/c/review/+/279721 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-01-07git-codereview: allow work on main branchesRuss Cox
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>
2021-01-07git-codereview: add a few more testsRuss Cox
Change-Id: I17ad065e8b4c1eb00cdd2f17af82be76bae4fc09 Reviewed-on: https://go-review.googlesource.com/c/review/+/279717 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-01-07git-codereview: update tests for "main" branch defaultRuss Cox
"git init ." leaves me on "main" now, not "master". Update tests to expect that, and update the "tracking" message too (otherwise the tests fail). Because not all gits agree about the initial branch name, set it explicitly too in the test. Fixes #42926. Change-Id: If3adb3bb53beba9efcd75cad0f081f59fba85fe7 Reviewed-on: https://go-review.googlesource.com/c/review/+/279873 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Austin Clements <austin@google.com>
2019-12-16git-codereview: write hooks with execute permission in testsBryan C. Mills
The 'write' helper function previously assumed file permission 0666. We don't actually need these files to be world-writable, but we do need specific ones — scripts executed as Git commit hooks — to be executable, at least on certain platforms. Also use t.Helper() to produce more useful log lines for failures. (That was added in order to diagnose TryBot failures.) Fixes golang/go#32836 Change-Id: I2d670563f42778ef8cf645445420756599c37ac6 Reviewed-on: https://go-review.googlesource.com/c/review/+/211477 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2018-11-08git-codereview: add -m optionJean de Klerk
The -m option allows a user to specify an inline commit message. This is useful for a few reasons; primary among them are the ability to easily automate a `git change` flow (e.g. in a CI/CD workflow) and the ease of creating one-liner commits (e.g. "regen protos"). Fixes golang/go#24912 Change-Id: Ie06886c74552ec615623c2faac285a1896bdac06 Reviewed-on: https://go-review.googlesource.com/c/107625 Run-TryBot: Yury Smolsky <yury@smolsky.by> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Yury Smolsky <yury@smolsky.by> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2016-09-15git-codereview: allow changing to a CLCaio Marcelo de Oliveira Filho
Now 'git change NNNN/PP' can be used to checkout (detached) the git commit corresponding to the patchset PP of the change NNNN. If the patchset is omitted, the current (latest) will be used. Branch names that are only numbers or numbers separated by a slash will always be understood as refering to CL. This break workflows that were using numbers as branch names, but this is expected to be uncommon. The workaround in this case is to use checkout directly. It gets the commit fetching the specific reference inside origin's refs/changes/ and check it out. It uses the gerrit API only if querying the current patchset is needed. Given that it's easy to mistype the number, change to a CL will show the subject of the commit it just checked out. Fixes golang/go#9255. Change-Id: I01b98f4672051a52b8b9110a41d93f3ffefebaf1 Reviewed-on: https://go-review.googlesource.com/20101 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-28git-codereview: make change fail with multiple pending changesCaio Marcelo de Oliveira Filho
When using 'git change' to amend the current change, it will fail if there are multiple pending changes. The previous behavior (amending the latest) wasn't always what the user intended. $ git change git-codereview: cannot amend change: multiple changes pending: fc60fd5 test: dummy change 6440cdc git-codereview: make change fail with multiple pending changes $ Unlike mail and submit, change doesn't support explicitly telling which commit to work on. Either 'git commit --amend' (for updating the topmost change) or a combination of 'git commit' and 'git rebase' must be used. Fixes golang/go#10443. Change-Id: I2f6ea1b0e302b66b627761d72d031a3b6aa0fba2 Reviewed-on: https://go-review.googlesource.com/20049 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-01-14git-codereview: diagnose local tracking branch ahead of remoteRuss Cox
Otherwise the git change error is a bit confusing. Change-Id: I8bacac175417231284a238a078e5ea9513866943 Reviewed-on: https://go-review.googlesource.com/2786 Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-23git-codereview: fix a few corner case failuresRuss Cox
- make it clearer what the random git command at the end of failures means - avoid some problems with detached HEAD mode in hooks run during git rebase - redirect all stdout/stderr into test buffers Change-Id: I102f22fc870f69c884728eaa46ecc95792d5b795 Reviewed-on: https://go-review.googlesource.com/2011 Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2014-12-22git-codereview: permit dot before colon in change descriptionAndrew Gerrand
Change-Id: I42601f47b318ab0be388480e17f627a757965486 Reviewed-on: https://go-review.googlesource.com/1992 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-18git-codereview: rename from 'git-review' to 'git-codereview'Andrew Gerrand
Mostly trivial search and replace, except for hooks.go which includes a special case to remove the old git-review hooks. Change-Id: Ic0792bb3e26607e5e0ead88958e46c3ac08288cd Reviewed-on: https://go-review.googlesource.com/1741 Reviewed-by: Russ Cox <rsc@golang.org>