Google gerrit repo, how git commit automatically generates Change-Id


1). Check if there is a commit-msg file under the repository.git/hook, if not, download it from the following address: 

<http://review.cyanogenmod.org/tools/hooks/commit-msg> 
<https://gerrit -review.googlesource.com/tools/hooks/commit-msg>If 

you have your own gerrit-review server, you can directly add `/tools/hooks/commit-msg` after the URL to download.

After adding, each time git commit is executed, Change-Id will be automatically generated in the log for gerrit code review.

2). If it is the code from repo sync, just find a repository and follow the above method to check whether there is a commit-msg soft link (repo sync is a soft link created under each repository .git/hooks), if not Exist, modify `.repo/manifest.xml` under the project directory, note that this xml file is also a soft link.

    <remote name="aosp" review="review.source.android.com" fetch=".." />
    <default revision="master" remote="aosp" sync-j="4" />


Note that must be added The above `review="review.source.android.com"` sentence. See why. python script under repo/repo.


Reprinted from: http://www.yinqisen.cn/blog-83.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326606660&siteId=291194637