aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/submit.go
AgeCommit message (Collapse)Author
6 daysgit-codereview: support remote other than "origin"HEADmainShulhan
For the git-codereview commands to works on any Go's repositories, the remote name for "origin" must be pointed to the Go original repository URL (in most cases the one with go.googlesource.com domain). The problem is when the "origin" is from the fork, all of the git-codereview commands then will not works. For example, in computer X, I clone the this repository from "https://go.googlesource.com/review" (the origin) and then push my changes on "git@git.sr.ht:~shulhan/go-x-review" (the fork). In another computer Y, I then clone from the fork to continue my works. The fork become origin. One of the solution is to rename the remote names manually each time we clone the fork. The only cons using this solution is every time new branch created we need to remember to pass "--set-upstream" during git push. This changes introduce "remote" configuration in codereview.cfg. When one first working on fork of Go repository, they set the "remote" key, commit it, and push it. When they cloned the fork, they did not needs to changes anything except adding new remote using the pre-defined name. Change-Id: I335d08fd8b7efe17ba07b3c0a3794f9ccf59b339
2025-10-24git-codereview: fix some commentscuishuang
Change-Id: I0650c81a855138049e9132d56cc742620ecaf185 Reviewed-on: https://go-review.googlesource.com/c/review/+/713362 Reviewed-by: Sean Liao <sean@liao.dev> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Sean Liao <sean@liao.dev> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-07-09git-codereview: frame sync as git codereview syncv1.16.0Matt T. Proud
The codereview binary referred to the sync subcommand as merely "git sync" in a number of places in user surfaces. This was wrong and misleading, so the code now refers to it with the codereview parent subcommand in the name (i.e., a "git codereview sync"). Change-Id: Icf3f96a8c76b57319bc3101b3e9fd0cbd8cecea9 Reviewed-on: https://go-review.googlesource.com/c/review/+/685855 Auto-Submit: Sean Liao <sean@liao.dev> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: David Chase <drchase@google.com>
2025-06-17git-codereview: explicitly include the codereview subcommand in suggested ↵Adam Bender
commands If a user does not have the recommended aliases in their .gitconfig, the suggested command will not work. Several suggestions have the codereview subcommand already; this change updates all suggestions to include it. Change-Id: I3613f24172c2d90a7038f263cad93cbdcddbbbca Reviewed-on: https://go-review.googlesource.com/c/review/+/681176 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Sean Liao <sean@liao.dev>
2021-01-13git-codereview: add reword commandRuss Cox
Quoting the new docs: The reword command edits pending commit messages. git codereview reword [commit...] Reword opens the editor on the commit message for each named commit in turn. When all the editing is finished, it applies the changes to the pending commits. If no commit is listed, reword applies to the most recent pending commit. Reword is similar in effect to running “git codereview rebase-work” and changing the script action for the named commits to “reword”, or (with no arguments) to “git commit --amend”, but it only affects the commit messages, not the state of the git staged index, nor any checked-out files. This more careful implementation makes it safe to use when there are local changes or, for example, when tests are running that would be broken by temporary changes to the checked-out tree, as would happen during “git codereview rebase-work”. Change-Id: I38ac939b8530bf237c6cafb911f2b17d22eaca60 Reviewed-on: https://go-review.googlesource.com/c/review/+/279718 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@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>
2020-12-22git-codereview: clean up usage message, docsRuss Cox
Change-Id: I634a9d47401c1000bcb38e9dd7e84296a3de00e6 Reviewed-on: https://go-review.googlesource.com/c/review/+/254746 Trust: Russ Cox <rsc@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-11git-codereview: add mail -trust to set Trust+1 voteRuss Cox
The expectation is that approvers will change their .gitconfig to define mail as codereview mail -trust. For golang/go#40699. Change-Id: I2a1040bf3f1c7248e9c361e1f2a83c17870b1df5 Reviewed-on: https://go-review.googlesource.com/c/review/+/254421 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-03-11git-codereview: remove use of MergeableRuss Cox
Mergeable has been removed from the Gerrit API - it was too expensive to maintain, had racy semantics, and was too little used. As of right now, git submit fails because it doesn't see "mergeable":true in the JSON. Remove the use of it in git-codereview. Change-Id: I12c821b9dbc44183a689d510dd20104eab5a0043 Reviewed-on: https://go-review.googlesource.com/c/review/+/222937 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-11-16git-codereview: add support for DΟ NΟT MAILRuss Cox
Also create a local DΟ NΟT SUBMIT check, although the Gerrit server is also taking care of that. While we're here, make fixup! and squash! commits non-mailable as well. (In the all caps text above the big Os are really Omicrons. Otherwise the CL would not be mailable or submittable.) Change-Id: Id1a9806b0d395d1a0bfc50ed7d7d22c64a48a2f1 Reviewed-on: https://go-review.googlesource.com/76877 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com> 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>
2016-02-05git-codereview: accept any commit spelling for mail and submitAustin Clements
Currently the mail and submit subcommands only accept commit hashes. This makes them inconsistent with other git commands (git is hard enough without having to remember another convention) and makes working with multi-commit branches cumbersome. Change mail and submit to accept any standard commit spelling. In particular, this makes it possible to use HEAD-relative names: "git mail HEAD" sends the whole current branch. We still require that the named commit be pending on the current branch to avoid accidentally naming a completely unrelated commit. Change-Id: If84d315e0fc32118a5283adfbca7a3b56f3c098c Reviewed-on: https://go-review.googlesource.com/19271 Reviewed-by: Russ Cox <rsc@golang.org>
2015-11-11git-codereview: add interactive mode to submitAustin Clements
This adds a -i option to submit that brings up a list of commits to submit in an editor (a la git rebase -i), lets the user edit the list, and then submits the specified commits in the specified order. Change-Id: I88149140527c987ae856aac2598f0a992fe5654d Reviewed-on: https://go-review.googlesource.com/16677 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-11git-codereview: factor pre-check for submittable changesAustin Clements
Change-Id: I92dad5653de950a6e920c8cb880dd34f98af9426 Reviewed-on: https://go-review.googlesource.com/16676 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-11git-codereview: allow multiple commit hashes for submitAustin Clements
This adds support to the submit subcommand for passing and submitting multiple commit hashes. Change-Id: Id030b07cac21d11acbeb8015fde9cb9e1acb1479 Reviewed-on: https://go-review.googlesource.com/16674 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-11git-codereview: factor submitting a single changeAustin Clements
This factors the logic for committing a single change in preparation for supporting submitting multiple changes at once. Change-Id: Ida083ada2c3a5393f99159e588dbc87af3902091 Reviewed-on: https://go-review.googlesource.com/16673 Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-30git-codereview: use cmd prefix on command implementation funcsRuss Cox
The name space is getting a bit crowded. These words are too easy to use for other variables or functions. Change-Id: Iedbccb82f85627fe422a029a6b45ad39a2e18dd0 Reviewed-on: https://go-review.googlesource.com/3627 Reviewed-by: Rob Pike <r@golang.org>
2015-01-06git-codereview: begin to handle multiple-change branchesRuss Cox
Gerrit supports multiple-change branches, and we'd like to make git-codereview useful for people using this mode of work. This CL is the first step. - remove error message on detecting a multiple-change branch - require 'git submit hash' in multiple-change branch - make git submit, git sync cleanup safe for multiple-change branch - adjust git pending output to show full information about multiple-change branch - add pending -c to show only current branch, since output is getting long We're not advertising or supporting this mode yet. For now the only way to enter it is to run 'git commit' to create the second commit. Perhaps eventually we will support something like 'git change -new'. Change-Id: I8284a7c230503061d3e6d7cce0be7d8d05c9b2a3 Reviewed-on: https://go-review.googlesource.com/2110 Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2014-12-22git-codereview: add TODO about go1.5.txt not needing reviewRuss Cox
Change-Id: Id0c73d56cc0cba8fbe5e67fb31ec5f96cbfb9d61 Reviewed-on: https://go-review.googlesource.com/2010 Reviewed-by: Russ Cox <rsc@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>