git-drover.1 9.42 KB
Newer Older
1 2 3
'\" t
.\"     Title: git-drover
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
sammc@chromium.org's avatar
sammc@chromium.org committed
4
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5
.\"      Date: 12/15/2016
6
.\"    Manual: Chromium depot_tools Manual
7
.\"    Source: depot_tools f72f1ad
8 9
.\"  Language: English
.\"
10
.TH "GIT\-DROVER" "1" "12/15/2016" "depot_tools f72f1ad" "Chromium depot_tools Manual"
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-drover \- Apply a commit from the trunk to a release branch, or from one release branch to another\&.
.SH "SYNOPSIS"
.sp
.nf
35 36 37
\fIgit drover\fR \-\-branch <branch>
           (\-\-cherry\-pick <change> | \-\-continue [path_to_workdir] |
            \-\-abort [path_to_workdir])
sammc@chromium.org's avatar
sammc@chromium.org committed
38 39
           [\-\-parent_checkout <path\-to\-existing\-checkout>]
           [\-\-verbose] [\-\-dry\-run]
40 41 42 43
.fi
.sp
.SH "DESCRIPTION"
.sp
44
git drover applies a commit to a release branch\&. It creates a new workdir from an existing checkout to avoid downloading a new checkout without affecting the existing checkout\&.
sammc@chromium.org's avatar
sammc@chromium.org committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58
.sp
git drover does not support reverts\&. See the EXAMPLE section for the equivalent sequence of commands to run\&.
.SH "OPTIONS"
.PP
\-\-branch <branch>
.RS 4
The branch to cherry\-pick the commit to\&.
.RE
.PP
\-\-cherry\-pick <commit>
.RS 4
The commit to cherry\-pick\&.
.RE
.PP
59 60 61 62 63 64 65 66 67 68
\-\-continue [path_to_workdir]
.RS 4
Continue a cherry\-pick that required manual resolution\&. The path to the drover workdir is optional\&. If unspecified, the current directory is used\&.
.RE
.PP
\-\-abort [path_to_workdir]
.RS 4
Abort a cherry\-pick that required manual resolution and clean up its workdir\&. The path to the drover workdir is optional\&. If unspecified, the current directory is used\&.
.RE
.PP
sammc@chromium.org's avatar
sammc@chromium.org committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82
\-\-parent_checkout
.RS 4
The path to the chromium checkout to use as the source for a creating git\-new\-workdir workdir to use for cherry\-picking\&. If unspecified, the current directory is used\&.
.RE
.PP
\-v, \-\-verbose
.RS 4
Enable verbose logging\&.
.RE
.PP
\-\-dry\-run
.RS 4
Skip landing the cherry\-pick\&. Just ensure that the commit can be cherry\-picked into the branch\&.
.RE
83
.SH "EXAMPLE"
84
.SS "PREREQUISITES"
85
.sp
86 87 88 89 90 91 92 93 94 95 96
Before working with branches, you must \fIgclient sync \-\-with_branch_heads\fR at least once to fetch the branches\&.
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBMerge Example\fR
.RS 4
.sp

97 98 99 100 101
.sp
.if n \{\
.RS 4
.\}
.nf
102
# Here\*(Aqs a commit (from some\&.committer) that we want to \*(Aqdrover\*(Aq\&.
103
\fB$ git log \-n 1 \-\-pretty=fuller\fR
104
commit 067e08ebd511040fa9d5350da54112300d9c1801
105 106 107 108 109 110 111 112
Author:     some\&.committer <some\&.committer@chromium\&.org>
AuthorDate: Thu Apr 10 08:54:46 2014 +0000
Commit:     some\&.committer <some\&.committer@chromium\&.org>
CommitDate: Thu Apr 10 08:54:46 2014 +0000

    This change needs to go to branch 9999

# Now do the \*(Aqdrover\*(Aq\&.
113
\fB$ git drover \-\-branch 9999 \-\-cherry\-pick 067e08ebd511040fa9d5350da54112300d9c1801\fR
114 115
Going to cherry\-pick
"""
116
commit 067e08ebd511040fa9d5350da54112300d9c1801
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
Author: some\&.committer <some\&.committer@chromium\&.org>
Date:   Thu Apr 10 08:54:46 2014 +0000

    This change needs to go to branch 9999
"""
to 9999\&. Continue (y/n)? y

# A cl is uploaded to rietveld, where it can be reviewed before landing\&.

About to land on 9999\&. Continue (y/n)? y
# The cherry\-pick cl is landed on the branch 9999\&.
.fi
.if n \{\
.RE
.\}
.sp
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBMerge with Conflicts Example\fR
.RS 4
.sp

.sp
.if n \{\
.RS 4
.\}
.nf
# Here\*(Aqs a commit (from some\&.committer) that we want to \*(Aqdrover\*(Aq\&.
\fB$ git log \-n 1 \-\-pretty=fuller\fR
151
commit e4fdcfa1a16c8b7265fb74a20cd029aa75cecaa8
152 153 154 155 156 157
Author:     some\&.committer <some\&.committer@chromium\&.org>
AuthorDate: Thu Apr 10 08:54:46 2014 +0000
Commit:     some\&.committer <some\&.committer@chromium\&.org>
CommitDate: Thu Apr 10 08:54:46 2014 +0000

    This change needs to go to branch 9999
158 159

# Now do the \*(Aqdrover\*(Aq\&.
160
\fB$ git drover \-\-branch 9999 \-\-cherry\-pick e4fdcfa1a16c8b7265fb74a20cd029aa75cecaa8\fR
sammc@chromium.org's avatar
sammc@chromium.org committed
161 162
Going to cherry\-pick
"""
163
commit e4fdcfa1a16c8b7265fb74a20cd029aa75cecaa8
sammc@chromium.org's avatar
sammc@chromium.org committed
164 165
Author: some\&.committer <some\&.committer@chromium\&.org>
Date:   Thu Apr 10 08:54:46 2014 +0000
166 167

    This change needs to go to branch 9999
sammc@chromium.org's avatar
sammc@chromium.org committed
168 169
"""
to 9999\&. Continue (y/n)? y
170

171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
Error: Patch failed to apply\&.

A workdir for this cherry\-pick has been created in
  /tmp/drover_9999

To continue, resolve the conflicts there and run
  git drover \-\-continue /tmp/drover_9999

To abort this cherry\-pick run
  git drover \-\-abort /tmp/drover_9999

\fB$ pushd /tmp/drover_9999\fR
# Manually resolve conflicts\&.
\fB$ git add path/to/file_with_conflicts\fR
\fB$ popd\fR
\fB$ git drover \-\-continue /tmp/drover_9999\fR

sammc@chromium.org's avatar
sammc@chromium.org committed
188
# A cl is uploaded to rietveld, where it can be reviewed before landing\&.
189

sammc@chromium.org's avatar
sammc@chromium.org committed
190 191
About to land on 9999\&. Continue (y/n)? y
# The cherry\-pick cl is landed on the branch 9999\&.
192 193 194 195 196
.fi
.if n \{\
.RE
.\}
.sp
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBRevert Example\fR
.RS 4
.sp

.sp
.if n \{\
.RS 4
.\}
.nf
# Make sure we have the most up\-to\-date branch sources\&.
\fB$ git fetch\fR

# Checkout the branch with the change we want to revert\&.
\fB$ git checkout \-b drover_9999 branch\-heads/9999\fR
Branch drover_9999 set up to track remote ref refs/branch\-heads/9999\&.

# Here\*(Aqs the commit we want to revert\&.
\fB$ git log \-n 1\fR
222
commit 00b47037e6732455c6b90f8800f4ffe5fbe7326d
223 224 225 226 227 228
Author: some\&.committer <some\&.committer@chromium\&.org>
Date:   Thu Apr 10 08:54:46 2014 +0000

    This change is horribly broken\&.

# Now do the revert\&.
229
\fB$ git revert 00b47037e6732455c6b90f8800f4ffe5fbe7326d\fR
230 231 232

# That reverted the change and committed the revert\&.
\fB$ git log \-n 1\fR
233
commit e31cae25b69f773e05ea206848d1479315f2e349
234
Author: you <you@chromium\&.org>
235 236 237 238
Date:   Thu Apr 10 09:11:36 2014 +0000

    Revert "This change is horribly broken\&."

239
    This reverts commit 00b47037e6732455c6b90f8800f4ffe5fbe7326d\&.
240 241 242 243

# As with old drover, reverts are generally OK to commit without LGTM\&.
\fB$ git cl upload \-r some\&.committer@chromium\&.org \-\-send\-mail\fR
\fB$ git cl land \-\-bypass\-hooks\fR
244
Using 50% similarity for rename/copy detection\&. Override with \-\-similarity\&.
245 246 247 248 249 250
.fi
.if n \{\
.RE
.\}
.sp
.RE
sammc@chromium.org's avatar
sammc@chromium.org committed
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBManual Merge Example\fR
.RS 4
.sp

.sp
.if n \{\
.RS 4
.\}
.nf
# Make sure we have the most up\-to\-date branch sources\&.
\fB$ git fetch\fR

# Here\*(Aqs a commit (from some\&.committer) that we want to \*(Aqdrover\*(Aq\&.
\fB$ git log \-n 1 \-\-pretty=fuller\fR
271
commit 87e5c05985d9c2ee235c6b7b5d29cc50f45783db
sammc@chromium.org's avatar
sammc@chromium.org committed
272 273 274 275 276 277 278 279 280 281 282 283 284
Author:     some\&.committer <some\&.committer@chromium\&.org>
AuthorDate: Thu Apr 10 08:54:46 2014 +0000
Commit:     some\&.committer <some\&.committer@chromium\&.org>
CommitDate: Thu Apr 10 08:54:46 2014 +0000

    This change needs to go to branch 9999

# Checkout the branch we want to \*(Aqdrover\*(Aq to\&.
\fB$ git checkout \-b drover_9999 branch\-heads/9999\fR
Branch drover_9999 set up to track remote ref refs/branch\-heads/9999\&.

# Now do the \*(Aqdrover\*(Aq\&.
# IMPORTANT!!! Do Not leave off the \*(Aq\-x\*(Aq flag
285 286
\fB$ git cherry\-pick \-x 87e5c05985d9c2ee235c6b7b5d29cc50f45783db\fR
[drover_9999 5c879cc] This change needs to go to branch 9999
sammc@chromium.org's avatar
sammc@chromium.org committed
287 288 289 290 291 292 293 294
 Author: some\&.committer <some\&.committer@chromium\&.org>
 Date: Thu Apr 10 08:54:46 2014 +0000
 1 file changed, 1 insertion(+)
 create mode 100644 modified_file

# That took the code authored by some\&.committer and committed it to
# the branch by the person who drovered it (i\&.e\&. you)\&.
\fB$ git log \-n 1 \-\-pretty=fuller\fR
295
commit 5c879cc29a19045571b08d9b058b8306bf7dee6c
sammc@chromium.org's avatar
sammc@chromium.org committed
296 297 298 299 300 301 302
Author:     some\&.committer <some\&.committer@chromium\&.org>
AuthorDate: Thu Apr 10 08:54:46 2014 +0000
Commit:     you <you@chromium\&.org>
CommitDate: Thu Apr 10 09:11:36 2014 +0000

    This change needs to go to branch 9999

303
    (cherry picked from commit 87e5c05985d9c2ee235c6b7b5d29cc50f45783db)
sammc@chromium.org's avatar
sammc@chromium.org committed
304 305 306 307 308

# Looks good\&. Ship it!
\fB$ git cl upload\fR
# Wait for LGTM or TBR it\&.
\fB$ git cl land\fR
309
Using 50% similarity for rename/copy detection\&. Override with \-\-similarity\&.
sammc@chromium.org's avatar
sammc@chromium.org committed
310 311 312 313 314 315 316
# Or skip the LGTM/TBR and just \*(Aqgit cl land \-\-bypass\-hooks\*(Aq
.fi
.if n \{\
.RE
.\}
.sp
.RE
317 318
.SH "SEE ALSO"
.sp
319
\fBgit-cherry-pick\fR(1), \fBgit-revert\fR(1)
320 321 322 323 324 325 326
.SH "CHROMIUM DEPOT_TOOLS"
.sp
Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "NOTES"
.IP " 1." 4
here
.RS 4
327
\%https://chromium.googlesource.com/chromium/tools/depot_tools.git
328
.RE