Clients using some Clang-Format options can run into bugs when using
0 lines of context. AlignConsecutiveAssignments in particular is picky
and behaves differently with 0 lines of context.
This behaviour lead to 'git cl format' behaving differently from
'git cl format --full'. That could also break presubmit format checks.
Using >0 lines of context for 'git diff' fixes the inconsistency.
Add a setting 'DIFF_LINES_OF_CONTEXT' that can be controlled via
codereview.settings. Defaults to zero to preserve the old behaviour.
The setting allows the client to control the number of lines of context
to use when running 'git cl format'.
Bug: angleproject:4003
Change-Id: Ied2ebf23df4c41ba19bfbd5b8ddf526b56a20b31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1864309
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Adds support for .yapfignore files to "git cl format" when formatting
Python files. yapf is supposed to parse the .yapfignore file in the
current working directory, but this appears to not work when files
are explicitly passed to yapf for formatting like they are in git cl
format. Instead, parse the .yapfignore file ourselves and skip over any
matching files.
Bug: angleproject:3985
Change-Id: I5e8469470fb8ddbaa914005b012ac1f39dfdd223
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1849807
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
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>
This option take the same format as -b / --bug but
spits out "Fixed: #,#" instead of "Bug: #,#".
This CL also looks for fix-, fixed-, and fixes-
branch prefixes and uses those as cue to add "Fixed:"
to the CL description when editing. This is a slight
behavioral change for fix- specifically, as it used
to produce "Bug: " instead.
Bug: monorail:4470
Change-Id: Ib24a1ff33ca3674e53fc5437f459ea5708988290
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1846785
Commit-Queue: Dan Beam <dbeam@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Dan Beam <dbeam@chromium.org>
Tag is the same as used by Gerrit plugin for the same functionality:
retry_failed:1
R=ehmaldonado
Change-Id: I14ef435b676088c86ae7cc0536c6a68fa58bd89f
Bug: 445502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1848258
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit f0faf48ddb.
Reason for revert:
Legacy properties are no longer used by Skia.
Original change's description:
> git-cl: Set legacy properties.
>
> Will be removed back again on Oct 9, 2019.
>
> Bug: 1004447
> Change-Id: I7003fac9ae8b184e2a7073b516535e8fd599f4f5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1825446
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
TBR=tandrii@google.com,ehmaldonado@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 1004447
Change-Id: I4e1fb31b6179bf10c3d9554cd313f7040aaf1b1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1847959
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Make it work the same way as "git cl try --retry-failed".
R=ehmaldonado
Change-Id: Id3a709dc40b6b6d068acbba0c610da254ced8ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1845478
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Get rid of _process_codereview_select_options and detected_codereview_from_url and simplify issue parsing.
Change-Id: I4200fd83ee868587c8627d6771c64f886b34a88b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1838384
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
This will prevent moving reviewers to cc when uploading patches.
Bug: 1010499
Change-Id: Ida16a4686f46350ba009bdaec1542895208c3f2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1835016
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
The expected behavior is that for CLs that were already uploaded
before, where some tryjobs were run and failed, git cl upload
--retry-failed will be kind of like git cl upload --cq-dry-run
except it will only trigger tryjobs that failed.
Bug: 985887
Change-Id: I6371bca3ba501b1ea2cd7160e2f933530d7e633f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1828322
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
There are many functions in git_cl that appear unused, although
it's possible that some of them are used in other places, where
git_cl may be imported as a library.
This CL just removes some of the private ones, which at least
were not supposed to be used from other places.
Things removed here:
- _get_commiter_timestamp
- _git_amend_head
- GitCookiesChecker._get_usernames_of_domain
- constants MERGE_BRANCH, CHERRY_PICK_BRANCH;
the comment says that these are supposed to
be used in CMDland, but apparently they aren't.
contextlib which is only used by this, is also
removed
- CodereviewSettingsFileMock in git_cl_test;
it is not used anywhere in the test, and I
assume that nobody's importing and using
git_cl_test...
git_cl_test still passes, git cl seems to still work
Change-Id: Ib8eee0dfb181c8cda04c0894d2daea52b3ad42ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818621
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
With certain git remote problems an error message is emitted that
has the place of the url and the place of the branch wrong.
Example:
Remote "opera" for branch "git@github.com:operasoftware/gn-opera.git"
points to "bratell/no_jumbo_for_s", but it doesn't exist.
Should be:
Remote "opera" for branch "bratell/no_jumbo_for_s" points to
"git@github.com:operasoftware/gn-opera.git", but it doesn't exist.
R=dpranke@chromium.org
Change-Id: I484ac8af226903a49df1f62e837d01c345fb5f02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1806595
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
auth_config is a Rietveld thing, so it's not necessary
in most of the code, except for triggering try bots.
Bug: 1001756
Change-Id: I0f243a297b05a43a61b052ba75c5886556e81b4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1793018
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
We can have --no-squash update the --squash state directly so we don't
have to constantly check two different knobs. This means opts.squash
is now a tristate: None means load config settings while True/False
means the user has specified a command line option. This also means
we don't have to detect multiple --squash/--no-squash flags as the
argparse module will take care of coalescing.
Bug: 993518
Test: `git cl upload` uses my ~/.gitconfig
Test: `git cl upload --squash` squashes
Test: `git cl upload --no-squash` doesn't squash
Change-Id: Ib2577db11d3af03c93cb47d8b78b341213720a92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1754234
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
CQ will soon start canceling tryjobs it triggered on no-longer-latest
patchsets if these tryjobs won't be re-used. New option can be used by
developers who upload new patchsets but actually care for prior
CQ-triggered tryjobs to complete.
This footer is effectively sticky, unless someone removes it by hand later.
We need to have the footer one way or another to tell the CQ what to do
(and provide a visible audit trail).
We may revisit the stickiness later based on accumulated usage data s.t.
the following uploads remove the footer unless the flag is passed.
Bug: 909895
Test: git cl upload --preserve-tryjobs
Change-Id: Ibbc6e917504c31eab8ab85296b3ecafd3add46df
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701506
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>