-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
115 lines (82 loc) · 2.73 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
gerrsh is a yet another tool for review changes from Gerrit inspired by git-review.
Sample review workflow
======================
Review process is done in the following steps:
1) checkout change from gerrit to local git:
$ gerrsh -c CHANGEID
$ gerrsh --comments-diff CHANGEID
2) apply comments, comments will be obtained from Gerrit,
generated in form of diff, and applied into current directory,
so they might be seen as diff in some difftool. Each commented
line is generated to separate hunk with comments added for this line:
$ git reset --hard HEAD
$ gerrsh --comments-diff CHANGEID | patch -p1
3) open diff tool and add comment:
----<snip>----
struct xxx {
> Vadym Kochan <aaa@bbb.ccc> wrote:
> | please use proper name
int a;
int b;
};
----</snip>---
add new comment by putting text under last '>' line:
----<snip>----
struct xxx {
> Vadym Kochan <aaa@bbb.ccc> wrote:
> | please use proper name
OK
Will do.
int a;
int b;
};
----</snip>---
exit difftool, and push comments to Gerrit, so all unprefixed (w/o ">", ">>" etc) new lines
will be used as comment. In this case message:
----<snip>----
OK
Will
----</snip>---
will be added as comment for line which contains 'struct xxx {'.
4) exit difftool and push comments to Gerrit:
$ gerrsh --comments-push CHANGEID
after push the comments will be seen as:
----<snip>----
struct xxx {
>> Vadym Kochan <aaa@bbb.ccc> wrote:
>> | please use proper name
> Vadym Kochan <aaa@bbb.ccc> wrote:
> | OK
> | Will do.
int a;
int b;
};
----</snip>---
if to re-apply comments diff.
Usage
=====
List all open reviews:
$ gerrsh
List all open reviews which has comments on patch set:
$ gerrsh -C
List all open reviews which has no conflicts (mergeable):
$ gerrsh -M
List all open reviews in which the owner is myself:
$ gerrsh --my
Checkout change from Gerrit into local git repo - it will create new branch
(if it does not exist) and checkout into it:
$ gerrsh -c
Show review comments in form of diff, it allows to redirect it into file
and apply it as a patch to local git repository and easy see them with some
git diff tool (vim-fugitive).Such approach allows to browse over comments
in terminal mode:
$ gerrsh --comments-diff CHANGEID
Apply diff from previous option into local git repository (changes will be showed by git
as 'modified'), it is recommented to perform 'git reset --hard HEAD' before applying:
$ gerrsh --comments-apply CHANGEID
Submit review reply:
$ gerrsh --review-msg 'nice!' --review-score +1 CHANGEID
$ gerrsh --review-msg 'needs to be refactored' CHANGEID
$ gerrsh --review-score +1 CHANGEID
Show review info:
$ gerrsh CHANGEID