git-drover.1 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. '\" t
  2. .\" Title: git-drover
  3. .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 05/03/2019
  6. .\" Manual: Chromium depot_tools Manual
  7. .\" Source: depot_tools e58cce6c
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-DROVER" "1" "05/03/2019" "depot_tools e58cce6c" "Chromium depot_tools Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-drover \- Apply a commit from the trunk to a release branch, or from one release branch to another\&.
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit drover\fR \-\-branch <branch>
  36. (\-\-cherry\-pick <change> | \-\-continue [path_to_workdir] |
  37. \-\-abort [path_to_workdir])
  38. [\-\-parent_checkout <path\-to\-existing\-checkout>]
  39. [\-\-verbose] [\-\-dry\-run]
  40. .fi
  41. .sp
  42. .SH "DESCRIPTION"
  43. .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\&.
  45. .sp
  46. git drover does not support reverts\&. See the EXAMPLE section for the equivalent sequence of commands to run\&.
  47. .SH "OPTIONS"
  48. .PP
  49. \-\-branch <branch>
  50. .RS 4
  51. The branch to cherry\-pick the commit to\&.
  52. .RE
  53. .PP
  54. \-\-cherry\-pick <commit>
  55. .RS 4
  56. The commit to cherry\-pick\&.
  57. .RE
  58. .PP
  59. \-\-continue [path_to_workdir]
  60. .RS 4
  61. Continue a cherry\-pick that required manual resolution\&. The path to the drover workdir is optional\&. If unspecified, the current directory is used\&.
  62. .RE
  63. .PP
  64. \-\-abort [path_to_workdir]
  65. .RS 4
  66. 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\&.
  67. .RE
  68. .PP
  69. \-\-parent_checkout
  70. .RS 4
  71. 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\&.
  72. .RE
  73. .PP
  74. \-v, \-\-verbose
  75. .RS 4
  76. Enable verbose logging\&.
  77. .RE
  78. .PP
  79. \-\-dry\-run
  80. .RS 4
  81. Skip landing the cherry\-pick\&. Just ensure that the commit can be cherry\-picked into the branch\&.
  82. .RE
  83. .SH "EXAMPLE"
  84. .SS "PREREQUISITES"
  85. .sp
  86. Before working with branches, you must \fIgclient sync \-\-with_branch_heads\fR at least once to fetch the branches\&.
  87. .sp
  88. .it 1 an-trap
  89. .nr an-no-space-flag 1
  90. .nr an-break-flag 1
  91. .br
  92. .ps +1
  93. \fBMerge Example\fR
  94. .RS 4
  95. .sp
  96. .sp
  97. .if n \{\
  98. .RS 4
  99. .\}
  100. .nf
  101. # Here\*(Aqs a commit (from some\&.committer) that we want to \*(Aqdrover\*(Aq\&.
  102. \fB$ git log \-n 1 \-\-pretty=fuller\fR
  103. commit 1f4859134ea36bfc71bab20d4b4463908860fd04
  104. Author: some\&.committer <some\&.committer@chromium\&.org>
  105. AuthorDate: Thu Apr 10 08:54:46 2014 +0000
  106. Commit: some\&.committer <some\&.committer@chromium\&.org>
  107. CommitDate: Thu Apr 10 08:54:46 2014 +0000
  108. This change needs to go to branch 9999
  109. # Now do the \*(Aqdrover\*(Aq\&.
  110. \fB$ git drover \-\-branch 9999 \-\-cherry\-pick 1f4859134ea36bfc71bab20d4b4463908860fd04\fR
  111. Going to cherry\-pick
  112. """
  113. commit 1f4859134ea36bfc71bab20d4b4463908860fd04
  114. Author: some\&.committer <some\&.committer@chromium\&.org>
  115. Date: Thu Apr 10 08:54:46 2014 +0000
  116. This change needs to go to branch 9999
  117. """
  118. to 9999\&. Continue (y/n)? y
  119. # A cl is uploaded to rietveld, where it can be reviewed before landing\&.
  120. About to land on 9999\&. Continue (y/n)? y
  121. # The cherry\-pick cl is landed on the branch 9999\&.
  122. .fi
  123. .if n \{\
  124. .RE
  125. .\}
  126. .sp
  127. .RE
  128. .sp
  129. .it 1 an-trap
  130. .nr an-no-space-flag 1
  131. .nr an-break-flag 1
  132. .br
  133. .ps +1
  134. \fBMerge with Conflicts Example\fR
  135. .RS 4
  136. .sp
  137. .sp
  138. .if n \{\
  139. .RS 4
  140. .\}
  141. .nf
  142. # Here\*(Aqs a commit (from some\&.committer) that we want to \*(Aqdrover\*(Aq\&.
  143. \fB$ git log \-n 1 \-\-pretty=fuller\fR
  144. commit 351e3be4c0f2f65ff1bcbcafd2fd4c53ab3b4587
  145. Author: some\&.committer <some\&.committer@chromium\&.org>
  146. AuthorDate: Thu Apr 10 08:54:46 2014 +0000
  147. Commit: some\&.committer <some\&.committer@chromium\&.org>
  148. CommitDate: Thu Apr 10 08:54:46 2014 +0000
  149. This change needs to go to branch 9999
  150. # Now do the \*(Aqdrover\*(Aq\&.
  151. \fB$ git drover \-\-branch 9999 \-\-cherry\-pick 351e3be4c0f2f65ff1bcbcafd2fd4c53ab3b4587\fR
  152. Going to cherry\-pick
  153. """
  154. commit 351e3be4c0f2f65ff1bcbcafd2fd4c53ab3b4587
  155. Author: some\&.committer <some\&.committer@chromium\&.org>
  156. Date: Thu Apr 10 08:54:46 2014 +0000
  157. This change needs to go to branch 9999
  158. """
  159. to 9999\&. Continue (y/n)? y
  160. Error: Patch failed to apply\&.
  161. A workdir for this cherry\-pick has been created in
  162. /tmp/drover_9999
  163. To continue, resolve the conflicts there and run
  164. git drover \-\-continue /tmp/drover_9999
  165. To abort this cherry\-pick run
  166. git drover \-\-abort /tmp/drover_9999
  167. \fB$ pushd /tmp/drover_9999\fR
  168. # Manually resolve conflicts\&.
  169. \fB$ git add path/to/file_with_conflicts\fR
  170. \fB$ popd\fR
  171. \fB$ git drover \-\-continue /tmp/drover_9999\fR
  172. # A cl is uploaded to rietveld, where it can be reviewed before landing\&.
  173. About to land on 9999\&. Continue (y/n)? y
  174. # The cherry\-pick cl is landed on the branch 9999\&.
  175. .fi
  176. .if n \{\
  177. .RE
  178. .\}
  179. .sp
  180. .RE
  181. .sp
  182. .it 1 an-trap
  183. .nr an-no-space-flag 1
  184. .nr an-break-flag 1
  185. .br
  186. .ps +1
  187. \fBRevert Example\fR
  188. .RS 4
  189. .sp
  190. .sp
  191. .if n \{\
  192. .RS 4
  193. .\}
  194. .nf
  195. # Make sure we have the most up\-to\-date branch sources\&.
  196. \fB$ git fetch\fR
  197. # Checkout the branch with the change we want to revert\&.
  198. \fB$ git checkout \-b drover_9999 branch\-heads/9999\fR
  199. Branch \*(Aqdrover_9999\*(Aq set up to track remote ref \*(Aqrefs/branch\-heads/9999\*(Aq\&.
  200. # Here\*(Aqs the commit we want to revert\&.
  201. \fB$ git log \-n 1\fR
  202. commit 8f0c06e50f535e3fcca2b189bb6b5d106bb1e5e6
  203. Author: some\&.committer <some\&.committer@chromium\&.org>
  204. Date: Thu Apr 10 08:54:46 2014 +0000
  205. This change is horribly broken\&.
  206. # Now do the revert\&.
  207. \fB$ git revert 8f0c06e50f535e3fcca2b189bb6b5d106bb1e5e6\fR
  208. # That reverted the change and committed the revert\&.
  209. \fB$ git log \-n 1\fR
  210. commit 829317133eb319e61f222fea996ca2703cd27fbe
  211. Author: you <you@chromium\&.org>
  212. Date: Thu Apr 10 09:11:36 2014 +0000
  213. Revert "This change is horribly broken\&."
  214. This reverts commit 8f0c06e50f535e3fcca2b189bb6b5d106bb1e5e6\&.
  215. # As with old drover, reverts are generally OK to commit without LGTM\&.
  216. \fB$ git cl upload \-r some\&.committer@chromium\&.org \-\-send\-mail\fR
  217. \fB$ git cl land \-\-bypass\-hooks\fR
  218. .fi
  219. .if n \{\
  220. .RE
  221. .\}
  222. .sp
  223. .sp
  224. If your cherrypick onto a release branch gets reverted, do not create a new cherrypick from master onto that release branch\&. Instead, use the "Reland" button on the original cherrypick CL\&.
  225. .RE
  226. .sp
  227. .it 1 an-trap
  228. .nr an-no-space-flag 1
  229. .nr an-break-flag 1
  230. .br
  231. .ps +1
  232. \fBManual Merge Example\fR
  233. .RS 4
  234. .sp
  235. .sp
  236. .if n \{\
  237. .RS 4
  238. .\}
  239. .nf
  240. # Make sure we have the most up\-to\-date branch sources\&.
  241. \fB$ git fetch\fR
  242. # Here\*(Aqs a commit (from some\&.committer) that we want to \*(Aqdrover\*(Aq\&.
  243. \fB$ git log \-n 1 \-\-pretty=fuller\fR
  244. commit ceb84b4befd7a7c060d210fdc57b3d0f46d68fa4
  245. Author: some\&.committer <some\&.committer@chromium\&.org>
  246. AuthorDate: Thu Apr 10 08:54:46 2014 +0000
  247. Commit: some\&.committer <some\&.committer@chromium\&.org>
  248. CommitDate: Thu Apr 10 08:54:46 2014 +0000
  249. This change needs to go to branch 9999
  250. # Checkout the branch we want to \*(Aqdrover\*(Aq to\&.
  251. \fB$ git checkout \-b drover_9999 branch\-heads/9999\fR
  252. Branch \*(Aqdrover_9999\*(Aq set up to track remote ref \*(Aqrefs/branch\-heads/9999\*(Aq\&.
  253. # Now do the \*(Aqdrover\*(Aq\&.
  254. # IMPORTANT!!! Do Not leave off the \*(Aq\-x\*(Aq flag
  255. \fB$ git cherry\-pick \-x ceb84b4befd7a7c060d210fdc57b3d0f46d68fa4\fR
  256. [drover_9999 bd9bd5b] This change needs to go to branch 9999
  257. Author: some\&.committer <some\&.committer@chromium\&.org>
  258. Date: Thu Apr 10 08:54:46 2014 +0000
  259. 1 file changed, 1 insertion(+)
  260. create mode 100644 modified_file
  261. # That took the code authored by some\&.committer and committed it to
  262. # the branch by the person who drovered it (i\&.e\&. you)\&.
  263. \fB$ git log \-n 1 \-\-pretty=fuller\fR
  264. commit bd9bd5b74ab9b942d127ddbefb99eec50b65fbf1
  265. Author: some\&.committer <some\&.committer@chromium\&.org>
  266. AuthorDate: Thu Apr 10 08:54:46 2014 +0000
  267. Commit: you <you@chromium\&.org>
  268. CommitDate: Thu Apr 10 09:11:36 2014 +0000
  269. This change needs to go to branch 9999
  270. (cherry picked from commit ceb84b4befd7a7c060d210fdc57b3d0f46d68fa4)
  271. # Looks good\&. Ship it!
  272. \fB$ git cl upload\fR
  273. # Wait for LGTM or TBR it\&.
  274. \fB$ git cl land\fR
  275. # Or skip the LGTM/TBR and just \*(Aqgit cl land \-\-bypass\-hooks\*(Aq
  276. .fi
  277. .if n \{\
  278. .RE
  279. .\}
  280. .sp
  281. .sp
  282. If git cl upload errors out, the branch you\(cqre uploading to probably has a CL with the same Change\-Id\&. Instead of cherry\-picking manually, use the Reland button in the Gerrit UI to create a new CL, and patch that CL into your client\&.
  283. .RE
  284. .SH "SEE ALSO"
  285. .sp
  286. \fBgit-cherry-pick\fR(1), \fBgit-revert\fR(1)
  287. .SH "CHROMIUM DEPOT_TOOLS"
  288. .sp
  289. 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\&.
  290. .SH "NOTES"
  291. .IP " 1." 4
  292. here
  293. .RS 4
  294. \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
  295. .RE