Add git squash-branch-tree

This script allows squashing a branch and all of its downstream
branches in one command.

This is useful for squashing stacked branches that have a lot of
commits each just before using `git rebase-update`, as this is
highly likely to run into a lot of rebase conflicts, repeatedly.

This should only be used if the user is okay with losing their
git commit history.

Change-Id: Id28a941d898def73f785d791499c7ee0784e0136
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5659262
Reviewed-by: Gavin Mak <[email protected]>
Reviewed-by: Josip Sokcevic <[email protected]>
Commit-Queue: Patrick Monette <[email protected]>
4 files changed
tree: b9d7a90ee6028562573e23fb9256f923acda7dd0
  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. .vpython3
  22. auth.py
  23. autoninja
  24. autoninja.bat
  25. autoninja.py
  26. bazel.py
  27. bb
  28. bb.bat
  29. black
  30. bootstrap_python3
  31. breakpad.py
  32. BUILD_OWNERS
  33. cipd
  34. cipd.bat
  35. cipd_bin_setup.bat
  36. cipd_bin_setup.sh
  37. cipd_client_version
  38. cipd_client_version.digests
  39. cipd_manifest.txt
  40. cipd_manifest.versions
  41. cipd_manifest_cros_python2.txt
  42. cipd_manifest_cros_python2.versions
  43. clang-format
  44. clang-format.bat
  45. clang_format.py
  46. codereview.settings
  47. compile_single_file
  48. compile_single_file.bat
  49. compile_single_file.py
  50. cpplint.bat
  51. cpplint.py
  52. cpplint_chromium.py
  53. cros
  54. CROS_OWNERS
  55. cros_python2.vpython
  56. detect_host_arch.py
  57. DIR_METADATA
  58. dirmd
  59. dirmd.bat
  60. download_from_google_storage
  61. download_from_google_storage.bat
  62. download_from_google_storage.py
  63. ensure_bootstrap
  64. fetch
  65. fetch.bat
  66. fetch.py
  67. gclient
  68. gclient-new-workdir.py
  69. gclient.bat
  70. gclient.py
  71. gclient_completion.sh
  72. gclient_eval.py
  73. gclient_paths.py
  74. gclient_scm.py
  75. gclient_utils.py
  76. gerrit_client.py
  77. gerrit_util.py
  78. git-cache
  79. git-cl
  80. git-credential-luci
  81. git-credential-luci.bat
  82. git-crrev-parse
  83. git-drover
  84. git-find-releases
  85. git-footers
  86. git-freeze
  87. git-gs
  88. git-hyper-blame
  89. git-map
  90. git-map-branches
  91. git-mark-merge-base
  92. git-nav-downstream
  93. git-nav-upstream
  94. git-new-branch
  95. git-number
  96. git-rebase-update
  97. git-rename-branch
  98. git-reparent-branch
  99. git-retry
  100. git-runhooks
  101. git-squash-branch
  102. git-squash-branch-tree
  103. git-thaw
  104. git-upstream-diff
  105. git_cache.py
  106. git_cl.py
  107. git_cl_completion.sh
  108. git_common.py
  109. git_completion.sh
  110. git_dates.py
  111. git_find_releases.py
  112. git_footers.py
  113. git_freezer.py
  114. git_hyper_blame.py
  115. git_map.py
  116. git_map_branches.py
  117. git_mark_merge_base.py
  118. git_nav_downstream.py
  119. git_new_branch.py
  120. git_number.py
  121. git_rebase_update.py
  122. git_rename_branch.py
  123. git_reparent_branch.py
  124. git_retry.py
  125. git_squash_branch.py
  126. git_squash_branch_tree.py
  127. git_upstream_diff.py
  128. gn
  129. gn.bat
  130. gn.py
  131. gn_helper.py
  132. google-java-format
  133. google-java-format.bat
  134. google_java_format.py
  135. gsutil.py
  136. gsutil.py.bat
  137. gsutil.vpython3
  138. isort
  139. led
  140. led.bat
  141. LICENSE
  142. lockfile.py
  143. luci-auth
  144. luci-auth.bat
  145. LUCI_OWNERS
  146. lucicfg
  147. lucicfg.bat
  148. mac_toolchain
  149. metrics.py
  150. metrics.README.md
  151. metrics_utils.py
  152. my_activity.py
  153. newauth.py
  154. ninja
  155. ninja.bat
  156. ninja.py
  157. ninja_reclient.py
  158. ninjalog.README.md
  159. ninjalog_uploader.py
  160. ninjalog_uploader_wrapper.py
  161. OWNERS
  162. owners_client.py
  163. owners_finder.py
  164. pinpoint
  165. pinpoint.bat
  166. post_build_ninja_summary.py
  167. PRESUBMIT.py
  168. presubmit_canned_checks.py
  169. presubmit_diff.py
  170. presubmit_support.py
  171. prpc
  172. prpc.bat
  173. pylint-2.17
  174. pylint-2.17.bat
  175. pylint-2.6
  176. pylint-2.6.bat
  177. pylint-2.7
  178. pylint-2.7.bat
  179. pylint_main.py
  180. pylintrc
  181. pylintrc-2.17
  182. python_runner.sh
  183. rdb
  184. rdb.bat
  185. rdb_wrapper.py
  186. README.gclient.md
  187. README.git-cl.md
  188. README.md
  189. reclient_helper.py
  190. reclient_metrics
  191. reclient_metrics.bat
  192. reclient_metrics.py
  193. reclient_metrics.README.md
  194. RECLIENT_OWNERS
  195. reclientreport
  196. reclientreport.bat
  197. reclientreport.py
  198. repo
  199. repo_launcher
  200. roll-dep
  201. roll-dep.bat
  202. roll_dep.py
  203. rustfmt.py
  204. scm.py
  205. setup_color.py
  206. siso
  207. siso.bat
  208. siso.py
  209. split_cl.py
  210. subcommand.py
  211. subprocess2.py
  212. swift-format
  213. swift_format.py
  214. update_depot_tools
  215. update_depot_tools.bat
  216. update_depot_tools_toggle.py
  217. upload_metrics.py
  218. upload_to_google_storage.py
  219. upload_to_google_storage_first_class.py
  220. utils.py
  221. vpython3
  222. vpython3.bat
  223. WATCHLISTS
  224. watchlists.py
  225. whitespace.txt
  226. win32imports.py
  227. yapf
  228. 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 [email protected],[email protected] --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.