Commit Graph

87 Commits (main)

Author SHA1 Message Date
Alexander Cooper 5c7e9a0782 Update depot_tools documentation for squash-closed
Fixed: 395115987
Change-Id: Ia6d27144e9cc0e8156affbafc7c481cfe048813a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6287829
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 week ago
Josip Sokcevic 0a3addbf63 [docs] Update readme with instructions for auto deployment
Bug: 396679832
Change-Id: Ic471c93b6aa9da64e3e43228bf5077c3e655c294
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6276740
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 week ago
Anne Redulla 213348885f [win-bootstrap] Update depot_tools_tutorial to install Git for Windows
Bug: b/360206460
Change-Id: I7f92312d7160c7406ad48bd506eab00636da986f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6278219
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Anne Redulla <aredulla@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 week ago
Josip Sokcevic 858ffc1da7 docs: Regenerate docs
Bug: 396174247
Change-Id: I79dba88457dc61c4e2a48d424b5520bab46bc1a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6266868
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
2 weeks ago
Josip Sokcevic ed3da5161f docs: Hide python warnings when generating docs
Those warnings end up going into man pages, which is not desired. The
warning says that pipes are deprecated, and will be removed in py3.13.

R=yiwzhang@google.com

Bug: 396174247
Change-Id: Ieb7f36de944e8b7b5e68f78c87a61b04e663f9d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6268243
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 weeks ago
Josip Sokcevic d49a21c533 docs: Fix make_docs
Bug: 396174247
Change-Id: I5888d14bec33e0484651b0b778666c15b05797ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6266867
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
2 weeks ago
Mason Freed 2451ee476d Reland: add a `--no-squash` argument to `git rebase-update`
See crbug.com/40264739 for many more details. But a prior attempt
to land this patch resulted in [1] which simply removed all
squashing behavior from `git rebase-update`. That broke several
people's workflows. So this patch attempts, again, to simply
add an opt-in to *not* squashing, for the folks (like me) who
do not want that behavior.

[1] https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6104282

Fixed: 40264739
Change-Id: I4a6aa8e53e854a7e601a0fb83f4f9fcb638d36ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6254099
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
2 weeks ago
Mason Freed a155deff42 Revert "Remove "attempt to squash" behavior from `git rebase-update`"
This reverts commit 58625e82c6.

Reason for revert: Several comments on crbug.com/40264739 that this broke their workflow. I plan to revert this and put patchset #2 back up for review, with an opt-in instead of a change to the default behavior.

Original change's description:
> Remove "attempt to squash" behavior from `git rebase-update`
>
> In common workflows, this step only succeeds ~5% of the time, and
> in the other 95% of cases, simply adds ~30 seconds of wasted time
> to the execution time of `rebase-update`. Therefore, this CL removes
> the automated functionality, and leaves squashing as a manual option
> to the user.
>
> Fixed: 40264739
> Bug: 40390274
> Change-Id: Ib2a3ffe4b0e5d0b74323a2a0d34ab0e1b7fafb08
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6104282
> Auto-Submit: Mason Freed <masonf@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Bug: 40390274
Change-Id: I91210a5a21b3751695553433389f346ba443bb1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6254237
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 weeks ago
Mason Freed 58625e82c6 Remove "attempt to squash" behavior from `git rebase-update`
In common workflows, this step only succeeds ~5% of the time, and
in the other 95% of cases, simply adds ~30 seconds of wasted time
to the execution time of `rebase-update`. Therefore, this CL removes
the automated functionality, and leaves squashing as a manual option
to the user.

Fixed: 40264739
Bug: 40390274
Change-Id: Ib2a3ffe4b0e5d0b74323a2a0d34ab0e1b7fafb08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6104282
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 months ago
Peter Birk Pakkenberg 6eeb55de17 Add --tree option to rebase-update.
I often find myself working on stacked changes, and this option will
make it easier to integrate changes into downstream CLs.

With `git rebase-update --current --tree --no-fetch`, it is possible
to only rebase the current chain of changes, without touching any other
local branches that may exist.
This is beneficial both for speed, and to avoid having to resolve merge
conflicts on branches unrelated to the changes you are currently working
on.

Change-Id: I2d3853ad5aad6c74db0ae26ff8d27d14dcaed3e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5546383
Auto-Submit: Peter Pakkenberg <pbirk@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
8 months ago
Allen Li c5a846299d [man] Fix make_docs.sh
Change-Id: I14c51773a86f0dc0b0d185d38908fff0d2afa3d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641213
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Allen Li <ayatane@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
8 months ago
Gavin Mak 0696c428b0 Switch to using issues.chromium.org bug links
Bug: b/323898035
Change-Id: I2dacc7d524fb11265d7c2385259b3a918d4fb6ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5270201
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
1 year ago
Gavin Mak f936d540e1 Remove __future__ imports
All __future__ imports (unicode_literals, print_function) are already
mandatory in py3. Also remove an outdated py2 comment in
presubmit_canned_checks.py

Bug: 1475402
Change-Id: I27cf6a8268f6dd1081f22af782c4c29a975376ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4867135
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year ago
Mike Frysinger 124bb8e53c switch to 4 space indent
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.

Reformatted using:
files=( $(
	git ls-tree -r --name-only HEAD | \
		grep -Ev -e '^(third_party|recipes)/' | \
		grep '\.py$';
	git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"

The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py

These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py

Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Arthur Milchior 138e18725c [depot_tools] clarify that new-branch also switch.
The way it was written, it seemed that it behaves as `git branch` instead of `git switch -c`.

R=ajp@google.com

Change-Id: Ibd4a205bd4b537ec7ff7e8235bb7afeee5e88347
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4514781
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org>
2 years ago
Victor Hugo Vianna Silva deff9a27cc [docs] Improve `git cl patch --help`
Change-Id: I001a1baafe2b136bbe89055fec5ae91118332d1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4660921
Reviewed-by: Andy Perelson <ajp@google.com>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Commit-Queue: Andy Perelson <ajp@google.com>
2 years ago
Joanna Wang 677da3c869 Revert "Add --no-squash argument to git rebase-update"
This reverts commit 80cc67cc00.

Reason for revert: Not +1'd by anyone from owning team.

Original change's description:
> Add --no-squash argument to git rebase-update
>
> --no-squash makes it faster to run rebase-update when there are merge
> conflicts and you know that squashing will not help. For example, I
> store all of my branches in one commit each, so I know that squashing
> isn't even possible because they are already squashed.
>
> Change-Id: I2679a855ad79d602a6d1ee09c140f2fd27ae20c5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2904096
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Joey Arhar <jarhar@chromium.org>

Change-Id: I0b577b053a3e6c7514e28cde4cb7849f50ecd64f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4411905
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Joey Arhar 80cc67cc00 Add --no-squash argument to git rebase-update
--no-squash makes it faster to run rebase-update when there are merge
conflicts and you know that squashing will not help. For example, I
store all of my branches in one commit each, so I know that squashing
isn't even possible because they are already squashed.

Change-Id: I2679a855ad79d602a6d1ee09c140f2fd27ae20c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2904096
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
2 years ago
Josip Sokcevic 8d2f774038 Use py3 in documentation generation
This change also updates version of git documentation to match one used in
depot_tools, asciidoc, and ansi2html. It also fixes reset signal.

R=gavinmak@google.com

Bug: 1357152
Change-Id: I998e7434dde8d82b491376b47a5993c6d91d64a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3856830
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic f8600e7806 [docs] Fix alias settings
When using alias, we no longer can't nor need to prefix command with
git. This change updates all [alias] blocks and removes git from it.

Change-Id: Id89142ef86935e04e21872ce61fb63a511ed40a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3244473
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 29521bc672 Use main ref in git-footers documentation
R=gavinmak@google.com

Fixed: 1118433
Change-Id: I15948b319ed847dce0d4222fcaad7fdf4620360c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3205608
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
3 years ago
Josip Sokcevic 26adc2a987 Fix generating man pages
Relevant change is in make_docs.sh, all other files were generated.

R=iannucci@chromium.org

Changes:
* upgrade to latest asciidoc, ansi2html and git
* disable interactive git editor (happens during rebase)
* minor tweaks
Change-Id: Ie4b19aa12b8a76826f66e3088c985b99e55164c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3000882
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic db632b6a13 Use main as default branch in documentation
Bug: 1118433
Change-Id: I55d4c1cecf881d39c3189ed4fa4ef71db6eede08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2981113
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
4 years ago
Solomon Kinard 053a717f02 Quick spelling update to man pages
Change-Id: Icd13bc19a59048ab9d90b6a55f68f052a0e2c4b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2797939
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
4 years ago
Gavin Mak 9a18e37fb9 Add documentation for --inject_current
This change adds documentation and demos missing for the flag
--inject_current used in git new-branch.

Bug: 1167943
Change-Id: Id6305b876ade2c47eb7435a5edd055ae4fe2f323
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2648615
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
4 years ago
James Zern fdd89469d6 update stale codereview.chromium.org links
w/chromium-review.googlesource.com

Change-Id: I8f024d68a3b89ae530fc1ce2806b9b12b83ba7b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2585050
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: James Zern <jzern@google.com>
4 years ago
Gavin Mak 8d7201bc3c Modify git map-branches to show the number of commits on a branch
Currently, for a given branch, map-branches displays the number of
commits ahead and behind it is. This change replaces ahead with
commits, representing the number of commits a branch has, starting from
its base commit, and more accurately reflects the state of a repo.

Bug:1128716
Change-Id: I7c070b4efd452d82d878e1cfb7c20d1c80f38ec7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2412991
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
5 years ago
Gavin Mak a787cd5e15 Update man files related to merge-base with better description
Change-Id: I9796d2034a8a3c1243defc7f18f0aee1d701ba00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2414569
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
5 years ago
Gavin Mak dd48130b29 update depot_tools_tutorial to include git reset issue
Bug:997395
Change-Id: Iabd189cb05ee9c87866697cc24c7d08d200b9b91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2412474
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
5 years ago
Clemens Backes 97adc5795e [man] Fix link to the git repository
"here" is not a nice name for the link, and the footnote generated for
the man page. Replace it by a properly named link.

Note that some of the changes in the generated files are unrelated.
Those files have not been updated since May 2019, and it seems like some
previous changes were not reflected yet.

R=ehmaldonado@chromium.org

Change-Id: I31c784e7eb649bcaa74ba223027fb2c142f52838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2346371
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
5 years ago
Robert Iannucci 4f30cf0179 [man] Followup: Fix order of depot_tools in PATH in html docs
This is a followup to https://chromium-review.googlesource.com/2124657

TBR=ahaas@chromium.org, ehmaldonado@chromium.org

Change-Id: I0cf8a73a645865700dc8ce5c2d17cc1915706ca5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2131384
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
5 years ago
Andreas Haas 71417ad5d3 [man] Fix order of depot_tools in PATH
For development in V8, and I guess also in Chrome, it is important that
depot_tools are at the beginning of $PATH. This was explicitly mentioned
in the original tutorial. However, it seems like a cleanup CL changed
this recently, see https://crrev.com/c/1593820. This CL changes the
order in $PATH back to the original order.

CC=marja@chromium.org, dmcardle@chromium.org
R=iannucci@chromium.org

Change-Id: Idaed3ada05cddd666734c03a25503fe5dc481e3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2124657
Auto-Submit: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Jeffrey Yasskin 6b52dc21e1 Default to origin's default branch instead of always origin/master.
BUG=1023031

Change-Id: I4bf3e33932af40600646f070f057a7c8c0661f33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1954624
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Jeffrey Yasskin <jyasskin@chromium.org>
5 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
Ran:
  vi $(git grep --name-only iteritems | grep -v third_party)
  vi $(git grep --name-only itervalues | grep -v third_party)
  vi $(git grep --name-only 'print ' | grep -v third_party)

and edited the files quickly with adhoc macros. Then ran in recipes/:
  ./recipes.py test train

There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.

Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
5 years ago
Raul Tambre 80ee78e7fa Convert print statements to Python 3 style
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
6 years ago
Daniel McArdle 43c083d5a4 Add missing options to git_rebase_update man page
Change-Id: I4c5e11d0b5434a6f31d72af78cd82abab06800e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1593820
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Bruce Dawson 9c06201209 Fix multiple confusingly escaped regex strings
Python (prior to 3.8) treats meaningless string escape sequences as if
they were a slash followed by the character. That is, '\w' == '\\w'.
Python 3.8 rejects this, and it's confusing. This change fixes seven of these
regex strings found in depot_tools (through a regex search, natch). Most of
the fixes don't actually change the value of the strings, and this was
manually verified:

>>> '(/c(/.*/\+)?)?/(\d+)(/(\d+)?/?)?$' == r'(/c(/.*/\+)?)?/(\d+)(/(\d+)?/?)?$'
True
>>> '#\s*OWNERS_STATUS\s+=\s+(.+)$' == r'#\s*OWNERS_STATUS\s+=\s+(.+)$'
True
>>> 'COM\d' == r'COM\d'
True
>>> '^\s+Change-Id:\s*(\S+)$' == r'^\s+Change-Id:\s*(\S+)$'
True
>>> 'ETag:\s+([a-z0-9]{32})' == r'ETag:\s+([a-z0-9]{32})'
True

Two exceptions were the regex expressions in filter_demo_output.py and scm.py.
These were turned into raw strings despite this changing the value of the
string passed to re. This works because re supports the \x, \d, \w, \t, and
other escape sequences needed to make this work.

TL;DR - use raw strings for regex to avoid melting your brain. If bulk changing
regex strings to raw watch out for double-slashes.

Bug: 958138
Change-Id: Ic45264cfc63e8bae9cfcffe2cd88a57c2d3dcdae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1590534
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Clemens Hammacher 7fa4fbc468 Update documentation of `git new-branch`
Include verbose output of `git map-branches` to make visible what the
state of the different branches is.

R=iannucci@chromium.org

Change-Id: I4af03ef15b39e4ba84a41c01d1ec801e7bb4bbd6
Reviewed-on: https://chromium-review.googlesource.com/c/1360711
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
6 years ago
Clemens Hammacher 03640c7fe5 Extend documentation for `git map-branches`
Document the -v and --no-color options.

R=iannucci@chromium.org

Change-Id: I07624403f591b23cc5701aa8201124fdfdb65781
Reviewed-on: https://chromium-review.googlesource.com/c/1360710
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
6 years ago
Clemens Hammacher 19238fc343 Revert "Fix semantics of git new-branch --upstream"
This reverts commit ba83229a73.

Reason for revert: After mail discussion we came to the conclusion that the old behavior makes more sense.

Original change's description:
> Fix semantics of git new-branch --upstream
> 
> Currently, the "--upstream A" option for new-branch behaves totally
> different than "--upstream_current". While "--upstream A" checks out
> branch A and then creates a new branch which tracks A,
> "--upstream_current" creates a new branch for the current HEAD and sets
> the upstream to the previously checked out branch.
> 
> As the documentation does not mention that any of the options changes
> the currently-checked-out commit (HEAD), this CL changes the semantics
> of "git new-branch --upstream A B" to be identical to "git checkout -b B
> && git branch --set-upstream-to A".
> 
> It also slightly extends the documentation to mention that in any case
> the new branch is based on HEAD.
> 
> R=​iannucci@chromium.org
> 
> Change-Id: Ic335d2caf27cb6afca1b8bc5a008424c0e880fca
> Reviewed-on: https://chromium-review.googlesource.com/c/1350748
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Auto-Submit: Clemens Hammacher <clemensh@chromium.org>

TBR=iannucci@chromium.org,tandrii@chromium.org,clemensh@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I7463935af172f0801c7da94d2de106a02fc4c42e
Reviewed-on: https://chromium-review.googlesource.com/c/1362972
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
6 years ago
Clemens Hammacher ba83229a73 Fix semantics of git new-branch --upstream
Currently, the "--upstream A" option for new-branch behaves totally
different than "--upstream_current". While "--upstream A" checks out
branch A and then creates a new branch which tracks A,
"--upstream_current" creates a new branch for the current HEAD and sets
the upstream to the previously checked out branch.

As the documentation does not mention that any of the options changes
the currently-checked-out commit (HEAD), this CL changes the semantics
of "git new-branch --upstream A B" to be identical to "git checkout -b B
&& git branch --set-upstream-to A".

It also slightly extends the documentation to mention that in any case
the new branch is based on HEAD.

R=iannucci@chromium.org

Change-Id: Ic335d2caf27cb6afca1b8bc5a008424c0e880fca
Reviewed-on: https://chromium-review.googlesource.com/c/1350748
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
6 years ago
Clemens Hammacher 7808a519be Fix typo in man page for git new-branch
The option is --upstream, not --uptstream.

R=sergiyb@chromium.org

Change-Id: I007dfecae9ba576d65bbb8b96c3f2296d2152a23
Reviewed-on: https://chromium-review.googlesource.com/c/1350747
Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
6 years ago
Robert Iannucci eb5f85b132 Fix minor regression in git_upstream_diff.
89734301bc introduced a new useful feature
to `git upstream-diff`, but unfortunately also regressed the behavior
of the tool when used with additional arguments for `git diff`.

This adds some additional documentation to demonstrate the intended
original feature (and fixes some of the bit-rot in the documentation
pipeline).

R=agable@chromium.org, mattm@chromium.org

Change-Id: I3ae48db3232c1ac84a7edbfe2225a17cda391a1e
Reviewed-on: https://chromium-review.googlesource.com/1107491
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable 48fe70296f Remove old git-cherry-pick-upload documentation
The command itself was removed in
https://chromium-review.googlesource.com/693339

Bug: 770408
Change-Id: Ie3006b75313715c395357efa6ffc67348e192c5c
Reviewed-on: https://chromium-review.googlesource.com/1070757
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
7 years ago
Simon Zünd 5e79d07891 Move path to depot to the front of PATH in the tutorial.
Adding it to the end caused issues since a cpplint.py version comes
preinstalled on the system at /usr/bin/cpplint.py, that is actually a symlink to
a bash script.
When the presubmit script is run, it uses python to run this bash script, causing it to fail.

Change-Id: Ib12cbdf20265c14e7252f30c268b5b4a9ce32193
Reviewed-on: https://chromium-review.googlesource.com/999595
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
7 years ago
Matt Mueller 89734301bc git-upstream-diff: add optional branch argument
Bug: 374928
Change-Id: I8f633ce172fc644e251193eb3fa4b67d62fb9dfa
Reviewed-on: https://chromium-review.googlesource.com/747365
Commit-Queue: Matt Mueller <mattm@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable 9756104b69 Document drover process for re-landing a CL in a release branch.
BUG=735230

Change-Id: Ia75170b3ea13c4c14eb7e8066ecb533f69adbc8d
Reviewed-on: https://chromium-review.googlesource.com/542038
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Francois Doray d42c68114c Add git cl split.
`git cl split` splits a branch into smaller branches and
uploads CLs.

Change-Id: Ic41cdabdd6241008ff48766e31a8d9d07995f2b0
Reviewed-on: https://chromium-review.googlesource.com/439706
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 96dc085dbe Add a manual page for git-cl
The most important git subcommand in depot_tools never had a man
page until today. And now "git help cl" and "git cl --help" will
work.

BUG=695623

Change-Id: Ic0d05fa8d70d2ef6e71d58e0d7d3e7adc4a2fa32
Reviewed-on: https://chromium-review.googlesource.com/447216
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Alan Cutter 0001782a88 Include branch name in git-squash-branch's default message
Change-Id: I5dfa6017d1c938f8e1c55fbd6e607909aa4d6811
Reviewed-on: https://chromium-review.googlesource.com/422589
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
8 years ago