Commit Graph

31 Commits (chrome/4147)

Author SHA1 Message Date
Quinten Yearsley 925cedba7b Run spellchecker on depot_tools
This was made by running `codespell` and `scspell`
and then checking the results.

Change-Id: I169fd5b40294f83015075b4a899fbca263821f25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2144602
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 69bb8bef75 presubmit_support: Support getting and adding footers.
Needed by Skia's PostUploadHooks, so that presubmit_support doesn't
depend on git-cl internal classes.

Bug: 1042324
Change-Id: If8f4e6ea035197667cd9705a4274590c4d11511e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2007670
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 5da394f8e1 depot_tools: Run git_footers_test on Python 3.
Bug: 1009809
Change-Id: I39bbb288a96bbb349747a3aa080f505d3b3a2cff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1835041
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Edward Lesmes 98eda3f3e4 Revert "depot_tools: Run Python scripts using vpython (Part 1)"
This reverts commit d6186f9936.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> depot_tools: Run Python scripts using vpython (Part 1)
> 
> Tbr: iannucci@chromium.org
> Bug: 984182
> Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

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

Change-Id: I7686985852608d0703bcbbab137df1ce82b29723
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 984182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1749853
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur d6186f9936 depot_tools: Run Python scripts using vpython (Part 1)
Tbr: iannucci@chromium.org
Bug: 984182
Change-Id: If36722e190d305f89d63dce91d0a600ddc34ebe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1748589
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 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
Aaron Gable 4be31878a8 Let git_footers split final paragraphs in specific cases
Suppose the final paragraph of a commit message looks like this:
    """
    And here's the final paragraph.
    Bug: 1234
    TBR=soandso
    Change-Id: deadbeef
    """
In this case, we don't want to lose the Bug and Change-Id footers,
so we process the whole final paragraph. *But* we'd also like to
help the user get things formatted correctly. This change lets
git_footers notice this situation, and insert a newline before the
first well-formed footer (Bug: in this case), so that the set of
well- and mal-formed footers are separated from the rest of the
malformed body text.

In the rare case where the last line of the last non-trailer paragraph
is a url, this will also visibly push the url into the block of
trailers (where it doesn't belong), prompting the user to fix it.
A more comprehensive fix for that particular case is coming later.

Bug: 766234
Change-Id: I6ae0072fff68ddf06e6f43b70f9a82a7f247f4ab
Reviewed-on: https://chromium-review.googlesource.com/849481
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
7 years ago
Aaron Gable d9a6756b24 Blacklist http(s): from being parsed as a git footer
It's unlikely that anyone would ever intend to have a git trailer
whose key is "http", but since URLs are often long, it is rather
likely that someone would put a URL on a line all by itself. When
that happens, don't accidentally interpret it as a footer.

R=iannucci, tandrii

Bug: 766234
Change-Id: I3101119c4e49e20339487618cc1719452b026d90
Reviewed-on: https://chromium-review.googlesource.com/849484
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 22a9cf54c9 git_footers: fix bug stdin-based message input.
Also adds tests for the bug and for --json output.

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

Change-Id: I4e2208fdad8e23d48d27d0a354470336a7b86180
Reviewed-on: https://chromium-review.googlesource.com/570030
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Aaron Gable b08ba6575e git_footer: be more resilient to malformed footers
Since split_footers became more resilient to malformed
footers and started returning the entire last paragraph,
instead of just the last paragraph iff it was entirely
well-formed, other functions like remove_footer need to
make sure they handle the case where not every line of
the footer paragraph can be parsed.

R=iannucci@chromium.org

Bug: 740601
Change-Id: I75c6c626d96942181f453abeee896ee92d14b20b
Reviewed-on: https://chromium-review.googlesource.com/565779
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov 1a91c6080a Nit fix for git_footers.
TBR=machenbach@chromium.org
Bug: 717504
Change-Id: Ifa71fa4cac0b57ed11ba5e7eb93516b23b72a496
Reviewed-on: https://chromium-review.googlesource.com/502809
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 04b51d6de0 Reland of Relax git_footers parsing to match that of Gerrit (JGit).
Previously landed as:
> Change-Id: Ieb6415d55e85b91f11f9052b0fd08cf982b64d51
> Reviewed-on: https://chromium-review.googlesource.com/501849

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

Bug: 717504
Change-Id: Iede5c29ff4c317b68d8c2bca319edec140a176f5
Reviewed-on: https://chromium-review.googlesource.com/502908
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
8 years ago
Andrii Shyshkalov 43ec62ec71 Revert "Relax git_footers parsing to match that of Gerrit (JGit)."
This reverts commit 28a5d5defd.

Reason for revert: breaks assumption in function for adding footers

Original change's description:
> Relax git_footers parsing to match that of Gerrit (JGit).
> 
> R=​agable@chromium.org
> 
> Bug: 717504
> Change-Id: Ieb6415d55e85b91f11f9052b0fd08cf982b64d51
> Reviewed-on: https://chromium-review.googlesource.com/501849
> Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
> Reviewed-by: Aaron Gable <agable@chromium.org>
> 

TBR=agable@chromium.org,machenbach@chromium.org,tandrii@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: 717504

Change-Id: I9b4d619b2972be8434aff9464f1959fbcb3abd32
Reviewed-on: https://chromium-review.googlesource.com/503030
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 28a5d5defd Relax git_footers parsing to match that of Gerrit (JGit).
R=agable@chromium.org

Bug: 717504
Change-Id: Ieb6415d55e85b91f11f9052b0fd08cf982b64d51
Reviewed-on: https://chromium-review.googlesource.com/501849
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable b584c4f0d1 Make CQ_INCLUDE_TRYBOTS support review-specific
This CL wholly revamps the way presubmit_support adds
CQ_INCLUDE_TRYBOTS lines in commit descriptions. In
particular, when the CL is being uploaded to Gerrit,
it uses our pre-existing support for manipulating git
footers to make the whole process much simpler.

R=tandrii@chromium.org

Bug: 710547
Change-Id: I5858282a44c590f131021fa3820f1cb3f70ef620
Reviewed-on: https://chromium-review.googlesource.com/487831
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Aaron Gable c06db440c9 Make git_footers.add_footer more flexible
This allows inserted footers to be specified as either before
or after other potentially-present footers.

It has one slight behavior change (reflected in the tests):
If after_keys is specified but *doesn't match* any pre-existing
footers, then the behavior does *not* switch to "insert as early
as possible". The behavior switch only happens if the after_keys
actually match a footer.

R=iannucci@chromium.org

Bug: 710547
Change-Id: If557978fe9309785285056eb557acbdc87960bb2
Reviewed-on: https://chromium-review.googlesource.com/487606
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov 80cae42d7f Fix git_footers to recognize footers with empty value.
R=agable@chromium.org,iannucci@chromium.org

Before, this block of footers won't be recognized by git_footers:
  Bug:
  Change-Id: xxx

because of empty value for "Bug:". This CL fixes this behavior.

Bug: 715614
Change-Id: Iabe45bfc027fda15cbe0cd5ce9b883ce3b891220
Reviewed-on: https://chromium-review.googlesource.com/487963
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov 1897532850 Python style fixes + unused imports removal in git cl and friends.
R=sergiyb@chromium.org
BUG=

Change-Id: I9b886100557bf6efa9be07d40175f7bb919f5294
Reviewed-on: https://chromium-review.googlesource.com/432456
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
agable 814b1cab2f Remove svn support from smaller git extensions
R=iannucci@chromium.org
BUG=475320

Review-Url: https://codereview.chromium.org/2354313003
8 years ago
Andrii Shyshkalov 49fe922ffa Fix git_footers to accept refs with periods in them.
For example, v8 has refs/heads/1.4.2

TBR=machenbach@chromium.org
BUG=chromium:674448

Change-Id: Ia3405ee402a01153fc9744457d8fee9385446cae
Reviewed-on: https://chromium-review.googlesource.com/420285
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
tandrii@chromium.org f2aa52b562 Refactor git_footers for later use in git cl.
Motivation: git_cl should start understanding Gerrit's git footers,
to avoid appending BUG= after Change-Id: Ixxx line.

R=sergiyb@chromium.org
BUG=614587

Review-Url: https://codereview.chromium.org/2028303006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300691 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
martiniss@chromium.org 456ca7f0c2 tryserver recipe_module: Add get_tags.
Lets you get CL tags for a given CL.

BUG=591172

Review-Url: https://codereview.chromium.org/1915833003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300658 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 9fc50db2cc Gerrit git cl: fix change-id appending.
Special case when the change description has no footers, but looks
like a footer.

R=machenbach@chromium.org,andybons@chromium.org
BUG=579176

Review URL: https://codereview.chromium.org/1812803002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299343 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 3c3c034d82 Add Gerrit's Change-Id handling to git_footers.
This should insert the message according to Gerrit's own commit-msg
hook implementation.

BUG=579183

Review URL: https://codereview.chromium.org/1758943002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299093 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
mmoss@chromium.org f0e4152061 Improve "dcommit in git repo" error message.
R=agable@chromium.org, iannucci@chromium.org

Review URL: https://codereview.chromium.org/1135563005.

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295609 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.

Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]

Review URL: https://codereview.chromium.org/955993006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
hinoka@chromium.org 4593f47b06 Git footer fix for v8
Git footers doesn't seem to support v8, let alone know that trunk actually maps
to the candidate branch.  This should fix it.

BUG=
TBR=agable

Review URL: https://codereview.chromium.org/645183002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292445 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
agable@chromium.org d629fb4084 Introduct git-auto-svn
This tool can automatically set up the necessary git-svn metadata for our
repos that live in SVN but are mirrored to Chrome.

R=iannucci@chromium.org, tandrii@chromium.org
BUG=418973

Review URL: https://codereview.chromium.org/611253003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292241 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 0a17dab124 Allow trunk to not end in a slash for git_footers.
R=luqui@chromium.org, prasadv@chromium.org
BUG=

Review URL: https://codereview.chromium.org/559773002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291897 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 74c44f6d69 Expand git-footers to read the svn position for any trunk path in any repo.
This is to support non-chrome repos in the bisect scripts.

R=hinoka@chromium.org, luqui@chromium.org
BUG=

Review URL: https://codereview.chromium.org/552403003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291895 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
luqui@chromium.org 0b88762379 Added git footers tool to parse conventional metadata from git commits
BUG=407316

Review URL: https://codereview.chromium.org/521033002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291777 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago