<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go-x-review/git-codereview/hook.go, branch main</title>
<subtitle>Fork of golang.org/x/review with my patches.</subtitle>
<id>http://git.kilabit.info/go-x-review/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/go-x-review/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/'/>
<updated>2026-04-09T15:20:06Z</updated>
<entry>
<title>git-codereview: support remote other than "origin"</title>
<updated>2026-04-09T15:20:06Z</updated>
<author>
<name>Shulhan</name>
<email>m.shulhan@gmail.com</email>
</author>
<published>2024-07-20T20:48:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=31f678e5a420fecf567c30bc66e40b43ad85fd17'/>
<id>urn:sha1:31f678e5a420fecf567c30bc66e40b43ad85fd17</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>git-codereview: explicitly include the codereview subcommand in suggested commands</title>
<updated>2025-06-17T17:40:36Z</updated>
<author>
<name>Adam Bender</name>
<email>abender@gmail.com</email>
</author>
<published>2025-06-12T02:12:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=c4af2b031e13e282462ea8ae4311bfabe115ae9d'/>
<id>urn:sha1:c4af2b031e13e282462ea8ae4311bfabe115ae9d</id>
<content type='text'>
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 &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Junyang Shao &lt;shaojunyang@google.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Auto-Submit: Sean Liao &lt;sean@liao.dev&gt;
</content>
</entry>
<entry>
<title>git-codereview: do not write hooks if -n is given</title>
<updated>2025-04-11T15:16:03Z</updated>
<author>
<name>Anatoli Babenia</name>
<email>anatoli@rainforce.org</email>
</author>
<published>2025-04-10T17:07:28Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=d5c513ca99314c64746d8c23dd8c126b9dbb3823'/>
<id>urn:sha1:d5c513ca99314c64746d8c23dd8c126b9dbb3823</id>
<content type='text'>
Fixes golang/go#73314

Change-Id: I881c2ae97f72990a6daac4919687f85cb24ac076
Reviewed-on: https://go-review.googlesource.com/c/review/+/664555
Auto-Submit: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
TryBot-Bypass: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
Reviewed-by: Carlos Amedee &lt;carlos@golang.org&gt;
</content>
</entry>
<entry>
<title>git-codereview: remove usage of io/ioutil</title>
<updated>2024-01-25T17:04:12Z</updated>
<author>
<name>Joshua Sing</name>
<email>joshua@hypera.dev</email>
</author>
<published>2023-11-19T03:29:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=0e3f2836ef3e230ced34f5550aa937610e076531'/>
<id>urn:sha1:0e3f2836ef3e230ced34f5550aa937610e076531</id>
<content type='text'>
io/ioutil is now deprecated. Use non-deprecated equivalents.

Change-Id: Iad1cc9c14dbdad3a6f9ada25072bc194bace4081
Reviewed-on: https://go-review.googlesource.com/c/review/+/543615
Reviewed-by: qiulaidongfeng &lt;2645477756@qq.com&gt;
Auto-Submit: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
</content>
</entry>
<entry>
<title>git-codereview: make hooks command report conflicting hooks</title>
<updated>2023-10-18T12:53:42Z</updated>
<author>
<name>siddharth ravikumar</name>
<email>s@ricketyspace.net</email>
</author>
<published>2023-09-12T02:34:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=8be3abfe097ddf04b28eec2783249d29b3a48dae'/>
<id>urn:sha1:8be3abfe097ddf04b28eec2783249d29b3a48dae</id>
<content type='text'>
Display warning message when a hook is already installed and is
different from the one installed by git-codereview.

Improves upon CL 184417.

Fixes golang/go#16777

Change-Id: I7579a3e86572e8b74f92317973e7cc7094b3942d
Reviewed-on: https://go-review.googlesource.com/c/review/+/377034
Auto-Submit: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Than McIntosh &lt;thanm@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@golang.org&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
</content>
</entry>
<entry>
<title>git-codereview: reword: apply commit message hook to edits</title>
<updated>2021-09-21T14:06:30Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-02-23T10:23:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=39ade5b068b47ea1606fc580f217ecd0cf940f8b'/>
<id>urn:sha1:39ade5b068b47ea1606fc580f217ecd0cf940f8b</id>
<content type='text'>
If you run "git codereview reword" you should get the same
"Fixes" fixing and Change-Id insertion as with regular commit
message editing.

Change-Id: I77220d42b49f575c07a7c1ef786c3775ee75133c
Reviewed-on: https://go-review.googlesource.com/c/review/+/295310
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>git-codereview: fix buglet in 'reword' related to work trees</title>
<updated>2021-01-15T16:51:21Z</updated>
<author>
<name>Than McIntosh</name>
<email>thanm@google.com</email>
</author>
<published>2021-01-14T16:02:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=027ac86e514dbb1000ae4ec5b282f39af4d2f7a3'/>
<id>urn:sha1:027ac86e514dbb1000ae4ec5b282f39af4d2f7a3</id>
<content type='text'>
The reword command was trying to store a saved messages file in the
subdirectory .git in the repo root; this doesn't work well if multiple
work trees are in use and the user is working in a non-main work tree.
Use "git rev-parse --git-path ." instead of "git rev-parse
--show-top-level" to find the location for the saved messages file.

Fixes golang/go#43695.

Change-Id: Ie0b3e810ad585fe1c18805f4070736335a2ef2b5
Reviewed-on: https://go-review.googlesource.com/c/review/+/283646
Run-TryBot: Than McIntosh &lt;thanm@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Trust: Than McIntosh &lt;thanm@google.com&gt;
</content>
</entry>
<entry>
<title>git-codereview: allow work on main branches</title>
<updated>2021-01-07T18:26:46Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-01-07T17:26:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=5617b8658c4ff7af5665cf0fd4bc5448d4ada7b9'/>
<id>urn:sha1:5617b8658c4ff7af5665cf0fd4bc5448d4ada7b9</id>
<content type='text'>
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 &lt;rsc@golang.org&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
Reviewed-by: Austin Clements &lt;austin@google.com&gt;
</content>
</entry>
<entry>
<title>git-codereview: make commit-msg hook play nicely with other systems</title>
<updated>2019-03-25T02:02:52Z</updated>
<author>
<name>Andrew Gerrand</name>
<email>adg@golang.org</email>
</author>
<published>2019-03-25T00:35:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=7744f6d7ac193720bb483dc2a2c266504b33d1a9'/>
<id>urn:sha1:7744f6d7ac193720bb483dc2a2c266504b33d1a9</id>
<content type='text'>
Gerrit requires 'Change-Id:' lines to be included in each commit
message, but they are not the only kind of 'metadata line' that might
appear in a commit message. Metadata lines observed by other systems
include 'Bug:' and 'Signed-off-by:'. This change ensures that the
commit-msg hook adds its 'Change-Id:' line to the set of metadata lines,
separated only by a single linefeed, rather than creating a new set by
inserting two line feeds.

Change-Id: Ia3bdce6f52f663685eea1e648874ef81ddb2bd91
Reviewed-on: https://go-review.googlesource.com/c/review/+/169097
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>git-codereview: create hooks directory if it doesn't exist</title>
<updated>2017-07-17T18:06:47Z</updated>
<author>
<name>Marko Mudrinic</name>
<email>mudrinic.mare@gmail.com</email>
</author>
<published>2017-07-16T18:59:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-review/commit/?id=d9d84288482b14b19527db3f0a0d4b4fc5a6bbd0'/>
<id>urn:sha1:d9d84288482b14b19527db3f0a0d4b4fc5a6bbd0</id>
<content type='text'>
Fixes golang/go#21028

On some versions of Git, "git init" will not create ".git/hooks
directory", causing "git change" to fail. This fix will check if the hooks
directory exists, and if not, create it.

Change-Id: I6a9e688740fde8701e5d48630686039c8ebf4172
Reviewed-on: https://go-review.googlesource.com/49070
Reviewed-by: Kevin Burke &lt;kev@inburke.com&gt;
</content>
</entry>
</feed>
