aboutsummaryrefslogtreecommitdiff
path: root/man/man1/codereview.1
blob: ec528b222ceab4c6f2459e884023c3509372b85a (plain)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
.TH CODEREVIEW 1
.SH NAME
codereview \- review of submitted changes (experimental)
.SH SYNOPSIS
.B git
.B diff
.B HEAD
.I path ...
.PP
.B codereview
[
.B -v
]
.B create
.I name
.PP
.B codereview
[
.B -v
]
.B commit
.PP
.B codereview
[
.B -v
]
.B upload
.PP
.B codereview
[
.B -v
]
.B pending
.PP
.B codereview
[
.B -v
]
.B sync
.SH DESCRIPTION
.I Codereview
manages the review and submission of changes to the Plan 9 from User Space project.
It must be used from within a Plan 9 from User Space tree
checked out via Git
(see
.IR git (1)).
.PP
A developer makes changes to a local copy of the tree,
reviews them by using
.I git
.I diff
.IR HEAD 
and then commits them to a ``feature branch''
using
.I codereview
.IR create .
Once a feature branch is created, files can still be edited, but they must then be
incorporated into the change by using
.I codereview
.IR commit .
.I Git
requires that changes be added to a ``staging area'' before the initial commit,
using commands such as
.I git
.I add
and
.I git
.IR rm .
The 
.I codereview
.I create
and
.I codereview
.I commit
commands
automatically move all local modifications to the staging area
as part of the commit,
using
.I git
.I commit
.IR -a .
.PP
If other changes have been committed since the feature branch was created,
.I codereview
.I sync
will update it to be based on the most recent copy of the repository.
.PP
When the code is ready for review,
.I codereview
.I upload
uploads the change to 
.HR https://plan9port-review.googlesource.com/
for review.
In order to upload, 
.I git
must have access to a 
.I $HOME/.netrc
that contains a password obtained from
.HR https://plan9port-review.googlesource.com/#/settings/http-password .
.PP
The most likely initial result of a code review is suggestions for
improving the code.
After making those changes, repeat the
.I codereview
.I commit
and 
.I codereview
.I upload
steps.
.PP
Once the code is ready, it will be submitted by the reviewer using the web interface.
At that point,
.I codereview
.I sync
.PP
The
.I codereview
.I pending
command lists the active feature branches.
.PP
All the
.I codereview
commands take a leading
.B -v
option, which causes them to print
.I git
commands being executed.
This can be useful for debugging
.IR codereview .
.PP
The
.I codereview
command depends on a 
.I git
``commit hook''
script being in place to add
.L Change-Id
lines to the commit messages.
.I Codereview
installs the hook at startup, if necessary,
by adding a symbolic link from
.B $PLAN9/.git/hooks/commit-msg
to
.BR $PLAN9/lib/git/commit-msg.hook .
.SH SEE ALSO
.IR git (1),
.HR http://plan9port-review.googlesource.com/
.SH BUGS
.I Git
is too complicated to use.
The 
.I codereview
script helps, but a working understanding of
.I git
is still required.