aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/doc.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2024-07-21 03:48:32 +0700
committerShulhan <m.shulhan@gmail.com>2026-04-09 22:20:06 +0700
commit31f678e5a420fecf567c30bc66e40b43ad85fd17 (patch)
treee3b1a4b83fb4db9e2dde3d3846966240e3b5e618 /git-codereview/doc.go
parent99962d5770bded6aa8fac22d4c74103b5f832d6d (diff)
downloadgo-x-review-31f678e5a420fecf567c30bc66e40b43ad85fd17.tar.xz
git-codereview: support remote other than "origin"HEADmain
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
Diffstat (limited to 'git-codereview/doc.go')
-rw-r--r--git-codereview/doc.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-codereview/doc.go b/git-codereview/doc.go
index 012e5ef..ca1b4b2 100644
--- a/git-codereview/doc.go
+++ b/git-codereview/doc.go
@@ -8,8 +8,9 @@ server.
The git-codereview tool manages “change branches” in the local git repository.
Each such branch tracks a single commit, or “pending change”,
-that is reviewed using a Gerrit server; the Gerrit remote must be
-named “origin” in the local git repo.
+that is reviewed using a Gerrit server.
+The Gerrit remote must be named “origin” in the local git repo, unless
+set in configuration under "remote" key.
Modifications to the pending change are applied by amending the commit.
This process implements the “single-commit feature branch” model.
@@ -425,6 +426,12 @@ would typically be “main”, in which case it would have this codereview.cfg:
branch: dev.feature
parent-branch: main
+The "remote" key specifies the name of git remote.
+If this setting is missing its default to "origin".
+This setting can be useful if you works on fork of the repository.
+Your fork can be still the named "origin" and the "upstream" (or other
+remote name) can be configured using this key.
+
In a more complex configuration, one feature branch might depend upon
another, like “dev.feature2” containing follow-on work for “dev.feature”,
neither of which has merged yet. In this case, the dev.feature2 branch