gerrit 提供了一种代码review解决方案,但每次代码提交之后都要设置每个commit的code reviewer, 实在是痛苦。
gerrit 在官方说明文档里面提供了解决方法,地址:https://gerrit-review.googlesource.com/Documentation/user-upload.html#push_create,
参考git push的Create Changes章节。

下面将一步一步的说明这个解决方法。
假设:
代码地址: ssh://fanxu123@fanxu.com:29418/test
分支:master
gerrit分支: HEAD:refs/for/master
reviewer: fanxu.china@gmail.com
A. 痛苦的做法:

  1. git push origin HEAD:refs/for/master
  2. 在gerrit管理网站,每个commit一个设置reviewer.

B. 直接命令里面设置
git push origin HEAD:refs/for/master%r=fanxu.china@gmail.com
其中, %r 指定了code reviewer 但这么长的一串, 每次push都来上这么一次,也挺痛苦的。

C. 最舒适的做法
首先 ,配置一个远程分支,将所有的参数,都一次性配置好。
修改工程目录下的 .git/config 文件, 添加以下字段:
[remote "review"]
url = ssh://fanxu123@fanxu.com:29418/test
push = HEAD:refs/for/master%r=fanxu.china@gmail.com
然后 ,以后每次推送直接用以下命令就可以啦, 完全无痛!
git push review
push = HEAD:refs/for/master%r=fanxu.china@gmail.com, r=other_man@lenovo.com

参考链接:
https://gerrit-review.googlesource.com/Documentation/user-upload.html#push_create
http://www.voidcn.com/article/p-qvycxwvc-bqt.html

【Gerrit】自动设置reviewer的更多相关文章

  1. 【转】WPF: 自动设置Owner的ShowDialog 适用于MVVM

    原文地址:http://www.mgenware.com/blog/?p=339 WPF中的Windows的ShowDialog方法并没有提供设置Owner的参数,开发者需要在ShowDialog前设 ...

  2. PowerShell脚本自动设置安卓手机wifi代理

    在实际测试工作中,经常要将安卓手机通过wifi代理的形式连接到本机的fiddler或charles服务器代理进行抓包测试.最近一直在想,有没有什么方法可以自动设置安卓手机的wifi代理,曾经想通过修改 ...

  3. 如何将ASP.NET MVC所有参数均自动设置为默认

    今天看到CSDN上有个问题觉得有点意思:"可不可以ASP.NET MVC所有参数均自动设置为默认" public class HomeController : Controller ...

  4. 使用批处理文件,自动设置计算机IP地址

    WIN7批处理设置IP地址不成功,显示“The filename, directory name, or volume label syntax is incorrect.”错误, 解决方法:将“本地 ...

  5. 自动设置iframe大小的jQuery代码

    自动设置iframe的宽度,如何用jquery来实现呢? 代码: <iframe src="main_folder.aspx" class="global_main ...

  6. Unity3D 导入贴图、模型等资源文件时自动设置参数

    脚本继承至AssetPostprocessor, 存放在Editor目录下! using UnityEngine; using System.Collections; using UnityEdito ...

  7. WPF: 自动设置Owner的ShowDialog 适用于MVVM

    原文:WPF: 自动设置Owner的ShowDialog 适用于MVVM 原文地址:http://www.mgenware.com/blog/?p=339 WPF中的Windows的ShowDialo ...

  8. Java:自动设置环境变量(转载)

    引用: https://blog.csdn.net/qq_22498277/article/details/72149038 脚本下载地址:http://files.cnblogs.com/floww ...

  9. Linux根据MAC地址自动设置IP

    Linux根据MAC地址自动设置IP #!/bin/sh #============config============ route_defa=60.12.70.65 addr_ip= link_ma ...

随机推荐

  1. 【u010】银河英雄传说

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 公元五八○一年,地球居民迁移至金牛座α第二行星,在那里发表银河联邦创立宣言,同年改元为宇宙历元年,并开 ...

  2. 【25.33%】【codeforces 552D】Vanya and Triangles

    time limit per test4 seconds memory limit per test512 megabytes inputstandard input outputstandard o ...

  3. ArcGIS Engine中正确释放打开资源

    转自原文 ArcGIS Engine中正确释放打开资源 AE中对MDB,SDE等数据库操作时,打开后却往往不能及时释放资源,导致别人操作提示对象被锁定. 很多帖子说了很多原理,看的也烦且不实用,比如一 ...

  4. [Ramda] Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

    When doing comparisons inside of functions, you end of relying heavily on the argument passed into t ...

  5. [NPM] Run npm scripts when files change with onchange

    In this lesson we will look at how we can setup our npm scripts to execute when the file system has ...

  6. OSGI简介—HelloWorld

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/wanghuan203/article/details/13631713 本次介绍的 HelloWor ...

  7. 简洁常用权限系统的设计与实现(四):不维护level,用递归方式构造树

    第三篇中,我们通过维护节点的深度level,通过迭代所有的节点,只需要一次,就构造了树.  本篇,换一种方式. 好处是:不维护节点的深度level,增加和修改节点时,也不用维护.递归实现,代码比较清晰 ...

  8. Visual Studio for Mac第四预

    微软发布Visual Studio for Mac第四预览版 去年 11 月,微软发布了 Visual Studio for Mac 的首个预览版本,并且承诺后续数月会带来更多功能.而今天,随着 Vi ...

  9. 在当前页获取父窗口中母版页中的服务器控件的ID

    parent.document.getElementById("ctl00_ContentPlaceHolder1_txt_name").value=""; A ...

  10. atheros wifi 动因分析

    Ar6003 驱动文档摘要 1.  wmi : wireless module interface //无线模块结构 2.  bmi : bootloader message interface 3. ...