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>
In git.git commit e4b75d6a1d31 (trace2: rename environment variables
to GIT_TRACE2*, 2019-05-19), the GIT_TR2_EVENT environment variable
is being renamed to GIT_TRACE2_EVENT.
Set both environment variables so that Git versions with and without
that change will both write traces to the tr2-event file.
The trace2 facility was introduced in Git 2.22.0. rc0 and rc1 use the
more cryptic GIT_TR2* name; rc2 and later (and in particular Git
2.22.0 final) will only support GIT_TRACE2*. In a week or so, once
this change finishes rolling out to the Googler population, we can
simplify "git cl" by only using the modern GIT_TRACE2_EVENT envvar and
GIT_TR2* will be lost to history.
Change-Id: Iade2ebfd4aff27270688d94514f5f35a4e34a29b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1636277
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jonathan Nieder <jrn@google.com>
If the encoding is not utf-8, datatime_now() will yield
> 'now': '2019-05-17 \xbf\xc0\xc0\xfc 11:28:31'(with CP949),
and it fails to decode it with utf-8 afterward.
> traces_readme, TRACES_README_FORMAT % git_push_metadata)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position 17: invalid start byte
For further information, please check out
https://bugs.chromium.org/p/chromium/issues/detail?id=955206#c16
Bug: 955206
Change-Id: I2733849735adc0361140b042ce617522c58fcc78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1621576
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Sang Woo Ko <sangwoo108@chromium.org>
There are some Google-internal repos that use a custom scheme. Having
any remotes pointing to these URLs breaks git cl archive.
Change-Id: Ibd686c5cd11e090f0821ff2b412540138252dfce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1614946
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
git-cl will print the path to the collected traces and git info,
but will only display the detailed message when git-cl fails.
Bug: 961663, 955206
Change-Id: I0a4d470aba24d696bdd5e02e069833f47cf56c02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1615665
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
In crbug.com/955206 they pointed out that:
- It's not clear when to upload the issue
- It's not clear where to report it, or where to look for existing issues.
- It's not made clear that the traces can contain information the user might not want to share.
I've reworded the message to address those concerns
Bug: 955206
Change-Id: Ia1426007d389328eac52babeee1ec3782c2b104e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1606608
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This is a reland of dc8e23d356
Original change's description:
> git-cl: Keep git push traces
>
> Keep the last N git push traces.
> Name them after the time when they were collected, and add a
> README file to each one to provide some context to developers.
>
> Bug: 955206
> Change-Id: Ib5fcf2f78fb65f6ddd80a93619c14e1ef70c5564
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595108
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Bug: 955206
Change-Id: Ie63a3ebfe3024d48ad7e0c8492a2939e635371aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1600246
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit dc8e23d356.
Reason for revert: Breaking chrome releases crbug.com/960638
Original change's description:
> git-cl: Keep git push traces
>
> Keep the last N git push traces.
> Name them after the time when they were collected, and add a
> README file to each one to provide some context to developers.
>
> Bug: 955206
> Change-Id: Ib5fcf2f78fb65f6ddd80a93619c14e1ef70c5564
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595108
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
TBR=dpranke@chromium.org,ehmaldonado@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 955206
Change-Id: Id56dfb1b32a54070d761ef75bc26bbb9081f86fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1600535
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
Keep the last N git push traces.
Name them after the time when they were collected, and add a
README file to each one to provide some context to developers.
Bug: 955206
Change-Id: Ib5fcf2f78fb65f6ddd80a93619c14e1ef70c5564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595108
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
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>
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>
The 'is' operator compares references, so a comparison with a string literal will always be false.
Found while using Python 3.8:
C:\Google\depot_tools/git_cl.py:1265: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if remote is not '.':
Change-Id: Ia77a1b350a3f0a2fe3c398e9a3b9aac8cfe38d4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1591516
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Collect git traces and prompt the user to upload them
when filling a bug.
Change-Id: Ic89fc848fdbfd497bd220dd54abf4ba35f40c39a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1555513
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This is a reland of 3c830222ae with a fix.
Previous CL relied on summary data of CQ votes provided by Gerrit,
which apparently isn't always present in the way I expected.
This resulted in "git cl status" returning "lgtm" instead of "commit"
on Skia recipe roll CLs, which resulted in recipe roller abandoning CLs,
and creating new ones (there might be a bug in recipe roller, too).
The fix is to iterate over all votes on CQ label and finding the highest
score, and then deciding on the state.
Original change's description:
> git cl status: differentiate "dry-run" from generic "commit".
>
> CQ vote now before
> +2 "commit" "commit"
> +1 "dry-run" "commit"
>
> R=ehmaldonado
>
> Tested: manual "git cl status" run locally.
> Change-Id: I342a3ac0830a67bf0e722c737ef00460a0df4b98
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1548287
> Auto-Submit: Andrii Shyshkalov <tandrii@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Change-Id: If9af5a2bf8f21d203b7a62740a27916eca0838ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1549640
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Running "git cl issue -r invalid_input" will now produce an error
message and continue, instead of crashing with a stacktrace.
Change-Id: I17626a513df904a1a3ff725ec7a17e8541db6bf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1538978
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
When an exception occurs in CheckCallAndFilter the push_returncode variable is used in the finally block without being initialized.
Traceback (most recent call last):
File "C:\Google\depot_tools\metrics.py", line 266, in print_notice_and_exit
yield
File "C:\Google\depot_tools\git_cl.py", line 5647, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\Google\depot_tools\git_cl.py", line 5629, in main
return dispatcher.execute(OptionParser(), argv)
File "C:\Google\depot_tools\subcommand.py", line 252, in execute
return command(parser, args[1:])
File "C:\Google\depot_tools\git_cl.py", line 4641, in CMDupload
return cl.CMDUpload(options, args, orig_args)
File "C:\Google\depot_tools\git_cl.py", line 1623, in CMDUpload
ret = self.CMDUploadChange(options, git_diff_args, custom_cl_base, change)
File "C:\Google\depot_tools\git_cl.py", line 2746, in CMDUploadChange
'exit_code': push_returncode,
UnboundLocalError: local variable 'push_returncode' referenced before assignment
Change-Id: Ife0e5226aa7e6127e8a508adb747f2c653ed8351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536033
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
For instance, if the bug-prefix is set to "b/", git cl upload will offer a
line with "Bug: b/", however it won't get stripped away if it's left blank,
unlike the default "Bug:" line. This change fixes that inconsistency by
also taking the bug-prefix into account when stripping.
Change-Id: Ib6e4d18c1ff52ec77cd1422be15b1e6920332238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528972
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jonas Termansen <sortie@google.com>
Warning message appears when trying to cherry-pick into a Chromium branch,
but doesn't actually mean anything right now.
"""
About to land on 3163. Continue (y/n)? y
It seems this repository has a Commit Queue, which can test and land changes for you.
Are you sure you wish to bypass it?
Press Enter to bypass CQ, or Ctrl+C to abort
"""
We want to disable until CQ for branches is fully developed.
Bug: 753213
Change-Id: I1cdfa084a6bad1be56b85a56e94e2dd27a099b2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1518291
Commit-Queue: Karen Qian <karenqian@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Example stderr output from Chrome:
[24599:24650:0306/123817.372418:ERROR:browser_process_sub_thread.cc(209)]
Waited 3 ms for network service
R=nodir@chromium.org
Change-Id: Idb71c9f3a2c735ee49b886896f55bdede559137c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1505792
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
In particular, only show robot comments from the latest patchset.
Bug: 924780
Change-Id: I12038ddd2d90a5cb561b248de3fd37908d5b927e
Reviewed-on: https://chromium-review.googlesource.com/c/1457282
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Git requires single quotes for paths with spaces.
We however need to convert single quotes to double quotes for Windows to treat such paths as a single path.
Bug: 916922
Change-Id: I89b23552a2a32d5aa58ea4f207690595823692d5
Reviewed-on: https://chromium-review.googlesource.com/c/1467301
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Sometimes CL author is also listed as OWNERS but want to find a co-owner
to review CL. Currently "git cl owners" is unhelpful as it consider the
author's ownership as enough.
Add a --ignore-self parameter to "git cl owners" that will cause the
tool to ignore author's ownership when looking for a reviewer.
Bug: none
Change-Id: Iba110a465a552cd6befb46c77b2e65f60b663a13
Reviewed-on: https://chromium-review.googlesource.com/c/1459625
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Commit a185e2e3c8 removed the Rietveld code review
implementation, albeit hasn't expunged all references to Rietveld. This leads
to an assertion error when running |git cl format| on a non-Gerrit change.
There appears to have been a recent attempt to articulate this error better in
a185e2e3c8, albeit not fix the underlying issue.
This change addresses the immediate issue by defaulting the code review
implementation to Gerrit rather than Reitveld.
R=joenotcharles@google.com, tandrii@chromium.org
Bug: 914150
Change-Id: I64d33e5a172cc43339ec417f7f0a7820e0337772
Reviewed-on: https://chromium-review.googlesource.com/c/1372928
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bryce Thomas <bryct@amazon.com>
Adding the diff.noprefix flag to .gitconfig broke python
formatting because git diffs were being parsed with regex
that relied on the default git diff prefixs.
This CL fix's this issue by always specifying prefix flags
for git diffs when formatting python.
Bug:846432
Change-Id: Ifde305da9574e6b46455a0237703b7364fac77e4
Reviewed-on: https://chromium-review.googlesource.com/c/1349809
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
On my machine, saves 0.16s of time while loading git cl:
from 0.32s to 0.16s.
R=ajp, ehmaldonado
Change-Id: I0febca43f11514da3e3f7be7e2c0184fb9e17409
Reviewed-on: https://chromium-review.googlesource.com/c/1344641
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>