Revert "Refactor git functionality out of Change and _DiffCache"

This reverts commit dd1a596c3e2573f600110d91007b2522fb9602d0.

Reason for revert: This doesn't scale well with large commit:
https://issues.chromium.org/issues/324293047

Original change's description:
> Refactor git functionality out of Change and _DiffCache
>
> A followup change will add support for change diff provided as user
> input through stdin/file.
>
> Bug: b/323243527
> Change-Id: I8d3420370e134859c61e35e23d76803227e4a506
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5254364
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>

Bug: b/323243527
Change-Id: Ic5179de6744a2ead629f512a5098f6e8c63d01c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5277255
Commit-Queue: Gavin Mak <gavinmak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 files changed
tree: 95be39f83abd3d68f91518491a9d7f201e7b33aa
  1. bootstrap/
  2. fetch_configs/
  3. hooks/
  4. infra/
  5. man/
  6. metadata/
  7. python-bin/
  8. python2-bin/
  9. recipes/
  10. testing_support/
  11. tests/
  12. third_party/
  13. win_toolchain/
  14. zsh-goodies/
  15. .cipd_impl.ps1
  16. .flake8
  17. .gitattributes
  18. .gitignore
  19. .isort.cfg
  20. .style.yapf
  21. .vpython
  22. .vpython3
  23. auth.py
  24. autoninja
  25. autoninja.bat
  26. autoninja.py
  27. autosiso
  28. autosiso.bat
  29. autosiso.py
  30. bazel.py
  31. bb
  32. bb.bat
  33. black
  34. bootstrap_python3
  35. breakpad.py
  36. BUILD_OWNERS
  37. cipd
  38. cipd.bat
  39. cipd_bin_setup.bat
  40. cipd_bin_setup.sh
  41. cipd_client_version
  42. cipd_client_version.digests
  43. cipd_manifest.txt
  44. cipd_manifest.versions
  45. cipd_manifest_cros_python2.txt
  46. cipd_manifest_cros_python2.versions
  47. clang-format
  48. clang-format.bat
  49. clang_format.py
  50. codereview.settings
  51. compile_single_file
  52. compile_single_file.bat
  53. compile_single_file.py
  54. cpplint.bat
  55. cpplint.py
  56. cpplint_chromium.py
  57. cros
  58. CROS_OWNERS
  59. cros_python2.vpython
  60. crosjobs
  61. detect_host_arch.py
  62. DIR_METADATA
  63. dirmd
  64. dirmd.bat
  65. download_from_google_storage
  66. download_from_google_storage.bat
  67. download_from_google_storage.py
  68. ensure_bootstrap
  69. fetch
  70. fetch.bat
  71. fetch.py
  72. gclient
  73. gclient-new-workdir.py
  74. gclient.bat
  75. gclient.py
  76. gclient_completion.sh
  77. gclient_eval.py
  78. gclient_paths.py
  79. gclient_scm.py
  80. gclient_utils.py
  81. gerrit_client.py
  82. gerrit_util.py
  83. git-cache
  84. git-cl
  85. git-crrev-parse
  86. git-drover
  87. git-find-releases
  88. git-footers
  89. git-freeze
  90. git-gs
  91. git-hyper-blame
  92. git-map
  93. git-map-branches
  94. git-mark-merge-base
  95. git-migrate-default-branch
  96. git-nav-downstream
  97. git-nav-upstream
  98. git-new-branch
  99. git-number
  100. git-rebase-update
  101. git-rename-branch
  102. git-reparent-branch
  103. git-retry
  104. git-runhooks
  105. git-squash-branch
  106. git-thaw
  107. git-upstream-diff
  108. git_cache.py
  109. git_cl.py
  110. git_cl_completion.sh
  111. git_common.py
  112. git_completion.sh
  113. git_dates.py
  114. git_find_releases.py
  115. git_footers.py
  116. git_freezer.py
  117. git_hyper_blame.py
  118. git_map.py
  119. git_map_branches.py
  120. git_mark_merge_base.py
  121. git_migrate_default_branch.py
  122. git_nav_downstream.py
  123. git_new_branch.py
  124. git_number.py
  125. git_rebase_update.py
  126. git_rename_branch.py
  127. git_reparent_branch.py
  128. git_retry.py
  129. git_squash_branch.py
  130. git_upstream_diff.py
  131. gn
  132. gn.bat
  133. gn.py
  134. goma_auth
  135. goma_auth.bat
  136. goma_ctl
  137. goma_ctl.bat
  138. gsutil.py
  139. gsutil.py.bat
  140. gsutil.vpython3
  141. infra_to_superproject
  142. infra_to_superproject.bat
  143. infra_to_superproject.py
  144. isort
  145. led
  146. led.bat
  147. LICENSE
  148. lockfile.py
  149. luci-auth
  150. luci-auth.bat
  151. LUCI_OWNERS
  152. lucicfg
  153. lucicfg.bat
  154. mac_toolchain
  155. metrics.py
  156. metrics.README.md
  157. metrics_utils.py
  158. my_activity.py
  159. ninja
  160. ninja.bat
  161. ninja.py
  162. ninja_reclient.py
  163. ninjalog.README.md
  164. ninjalog_uploader.py
  165. ninjalog_uploader_wrapper.py
  166. OWNERS
  167. owners_client.py
  168. owners_finder.py
  169. pinpoint
  170. pinpoint.bat
  171. post_build_ninja_summary.py
  172. PRESUBMIT.py
  173. presubmit_canned_checks.py
  174. presubmit_support.py
  175. profile.xml
  176. prpc
  177. prpc.bat
  178. pylint-2.17
  179. pylint-2.17.bat
  180. pylint-2.6
  181. pylint-2.6.bat
  182. pylint-2.7
  183. pylint-2.7.bat
  184. pylint_main.py
  185. pylintrc
  186. pylintrc-2.17
  187. python_runner.sh
  188. rdb
  189. rdb.bat
  190. rdb_wrapper.py
  191. README.gclient.md
  192. README.git-cl.md
  193. README.md
  194. reclient_helper.py
  195. reclient_metrics
  196. reclient_metrics.bat
  197. reclient_metrics.py
  198. reclient_metrics.README.md
  199. RECLIENT_OWNERS
  200. reclientreport
  201. reclientreport.bat
  202. reclientreport.py
  203. repo
  204. repo_launcher
  205. roll-dep
  206. roll-dep.bat
  207. roll_dep.py
  208. rustfmt.py
  209. scm.py
  210. setup_color.py
  211. siso
  212. siso.bat
  213. siso.py
  214. split_cl.py
  215. subcommand.py
  216. subprocess2.py
  217. swift-format
  218. swift_format.py
  219. update_depot_tools
  220. update_depot_tools.bat
  221. update_depot_tools_toggle.py
  222. upload_metrics.py
  223. upload_to_google_storage.py
  224. utils.py
  225. vpython
  226. vpython.bat
  227. vpython3
  228. vpython3.bat
  229. WATCHLISTS
  230. watchlists.py
  231. weekly
  232. whitespace.txt
  233. win32imports.py
  234. wtf
  235. yapf
  236. yapf.bat
README.md

depot_tools

Tools for working with Chromium development. It requires python 3.8.

Tools

The most important tools are:

  • fetch: A gclient wrapper to checkout a project. Use fetch --help for more details.
  • gclient: A meta-checkout tool. Think repo or git submodules, except that it support OS-specific rules, e.g. do not checkout Windows only dependencies when checking out for Android. Use gclient help for more details and README.gclient.md.
  • git cl: A code review tool to interact with Rietveld or Gerrit. Use git cl help for more details and README.git-cl.md.
  • roll-dep: A gclient dependency management tool to submit a dep roll, updating a dependency to a newer revision.

There are a lot of git utilities included.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0 or run ./update_depot_tools_toggle.py --disable.

To update package manually, run update_depot_tools.bat on Windows, or ./update_depot_tools on Linux or Mac.

On Windows only, running gclient will install git and python.

Contributing

To contribute change for review:

git new-branch <somename>
# Hack
git add .
git commit -a -m "Fixes goat teleporting"
# find reviewers
git cl owners
git log -- <yourfiles>

# Request a review.
git cl upload -r reviewer1@chromium.org,reviewer2@chromium.org --send-mail

# Edit change description if needed.
git cl desc

# If change is approved, flag it to be committed.
git cl set-commit

# If change needs more work.
git rebase-update
...
git cl upload -t "Fixes goat teleporter destination to be Australia"

See also open bugs, open reviews, forum or report problems.

cpplint.py

Until 2018, our cpplint.py was a copy of the upstream version at https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that repository is not maintained any more. If you want to update cpplint.py in depot_tools, just upload a patch to do so. We will figure out a long-term strategy via issue https://crbug.com/916550.

Note that the cpplint.py here is also used by the Tricium analyzer, so if the cpplint.py here changes, we should also update the copy used there.