| Age | Commit message (Collapse) | Author |
|
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
|
|
Use url.Parse and check URL components rather than performing imprecise
string matching. This addresses a bug where git-codereview does not work
when the Git origin ends with a forward slash.
Note that the check for 'github.com' has been removed since the test for
'.googlesource.com' already excludes it.
Change-Id: I083bccdbacf2152cbfddd2407fb20afa47c8e91e
Reviewed-on: https://go-review.googlesource.com/c/review/+/543495
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
|
|
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 <2645477756@qq.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
|
|
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>
|
|
Change-Id: I43e14ef54a5c9936f3c80fa87e9b9f0ed468b05a
Reviewed-on: https://go-review.googlesource.com/c/151737
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
|
|
Loading codereview.cfg from origin/master
effictively means that users have to ask permission
to use git-codereview.
With this change, users can opt to add the file,
.gitignore it, and forget about it.
Looking in origin/master also makes it hard
to try out git-codereview on a project
without having to commit to it.
Instead of requiring codereview.cfg be checked in
anywhere, just look on the filesystem for it.
I can't figure out why I ever thought
doing otherwise was a good idea.
There are some other related fixes floating around,
which might also be good to put in,
but this is seems like a good stop-gap,
since it is a minimal change;
codereview.cfg continues to work for anyone
currently using it.
Related: golang/go#15616
Related: golang/go#15073
Change-Id: I1e377819f8eb8c8fecf9f022459551a3e8b93d48
Reviewed-on: https://go-review.googlesource.com/24001
Reviewed-by: Andrew Gerrand <adg@golang.org>
|
|
The git-review module is useful for other gerrit sites. Some
host gerrit under a sub-path. Add tests for both googlesource.com
repos and non-googlesource.com repos.
Change-Id: If2848128d6957db61ac50cbab7e6927da431002b
Reviewed-on: https://go-review.googlesource.com/20553
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
|
|
Every time I accidentally type 'git pending' in a non-Gerrit repository,
that command installs hooks, and then I have to zero the hook files
to keep working.
First, don't install the hooks if this looks like a non-Gerrit git repo.
That seems like it will play well with others.
But, people might also want to use the non-Gerrit parts of the tool,
so if people do say 'git codereview hooks', let that install them.
And then if the hooks are invoked in a non-Gerrit repo, selectively
disable the Gerrit-specific parts. For example, if it's not a Gerrit repo
we might still want to check and fix 'Fixes #N' lines if directed by the
config, but we don't want to add Change-Id lines.
Now that things are a bit better behaved, also leave the hooks on
in detached head mode. I've found that it's quite frustrating not
to have the hooks on when working midway through git rebase -i.
If we find reasons that the hooks were off we can try to figure out
how to split the difference.
Fixes golang/go#12170.
Change-Id: I69fa156ce4fd11c0c84416088cd972957ce1ce6d
Reviewed-on: https://go-review.googlesource.com/19560
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
|
|
We have a single repo against which all issues are filed.
GitHub supports closing issues in other repos,
but it is easy to forget to use the magic syntax.
To fix that, rewrite issue references in the commit msg hook.
To that end, introduce a repo-level config file,
located at REPOROOT/codereview.cfg.
The config is always read from origin/master.
Config lines are of the form "key: value".
Lines beginning with # are comments.
To designate a repo as the issues repo, add
issuerepo: USERNAME/REPO
to the config.
Fixes golang/go#9273.
Change-Id: I31ec98883641bbf0c149f3619769231f6a452512
Reviewed-on: https://go-review.googlesource.com/4131
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
|