Commit Graph

175 Commits (dfaf79d831a1bdb5e72c14045e82b18744ccc40a)

Author SHA1 Message Date
nick@chromium.org 3ac1c4e320 Depot tools: use the clang-format binaries that are now included
as part of the Chromium checkout.

This follows the approach used by gn.

Changes include:
 - in-the-PATH clang-format trampoline scripts
 - clang_format.py, which finds clang-format binaries inside of Chrome
 - Hook 'git cl format' to the new binaries and scripts
 - Rearrange some code, for reuse between clang_format.py and gn.py

BUG=240309
TEST=presubmits (one failure on mac, but it fails on a clean checkout too)

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@245074 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
rmistry@google.com 907525863f Add support for BUG_PREFIX in codereview.settings.
This change will allow projects other than chromium to specify 'BUG_PREFIX: project_name:' in their codereview.settings file.
Currently, the change is created with 'BUG=', entering a project's bug number there will point it to chromium's issue tracker. Adding a project specific prefix will make the links point to the project's issue tracker without the developer having to know about the magic prefix.

BUG=skia:1983

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@244801 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
jochen@chromium.org 3ec0d54fd7 Indiciate the tree status in the rietveld message when bypassing hooks
BUG=none
R=iannucci@chromium.org,maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@244793 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org 91141377b8 Added --email to git_cl.py
Passing the email address used to connect to Rietveld on the command
line is useful for testing purposes, in particular with a test server.

BUG=331123

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@244017 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org 87884cc015 Added --(de)activate-update options
These options have been added to the 'git cl config' subcommand.
--deactivate-update tells git cl not to update the values inside
.git/config from the codereview.settings file. --activate-update does
the opposite.

This is designed for testing/development purposes only, for example, to
be able to change the rietveld URL.

BUG=327901

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@242943 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
fischman@chromium.org d246c9723c git_cl.py: emit a more helpful message when [git try] should be used instead of [git cl try].
BUG=330321

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@242301 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
binji@chromium.org c3d17dd54a git_cl.py: In the "status" command, add space after the branch name.
i.e. the output looks like:

   my-branch-name : https://codereview.chromium.org/1234567
  my-other-branch : https://codereview.chromium.org/8675309

This makes it possible to double-click the branch name to use it in a subsequent
command.

BUG=none
R=maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@241731 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
stip@chromium.org 43064fd5bf Add support for new-style trybot specifications to git_cl.py.
BUG=278554

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@241629 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
yujie.mao@intel.com daee1d319a Fix TypeError: cannot concatenate 'str' and 'int' objects
BUG=None
TEST=Error log print

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@241544 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 4ac2553282 Honor svn-remote.*.rewriteRoot option.
MatchSvnGlob uses the root url to grep for existing svn commits by
matching the git-svn-id lines in the commit messages.  If there is a
rewriteRoot config, then the git-svn-id lines will have the
rewritten url's, and the code should match against that.

R=blundell@chromium.org,maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@241043 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
jsbell@chromium.org aeab41a341 Add "in the commit queue" state to git cl status colors
R=dpranke@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@239830 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
enne@chromium.org ff7a1fb94a Let git cl format be runnable outside of the root
This will also enable git cl format to be more easily runnable by
presubmit within a subdirectory.

BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@239821 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
thestig@chromium.org 00858c8486 Add git cl web command to open the current issue in the web browser.
R=maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@238220 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
ukai@chromium.org 7044efcc7b GERRIT_PORT is no longer used in git_cl.py
BUG=maruel@chromium.org,szager@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@237657 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
ukai@chromium.org 712d6105b3 Download commit-msg from gerrit-review.googlesource.com
Tell download tools/hooks/commit-msg mannually if it looks broken.

chrome-internal-reviews.googlesource.com requires
authentication to access tools/hooks/commit-msg, and
we'll get Google Sign-in page rather than expected shell script.

R=szager@chromium.org,maruel@chromium.org,ilevy@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@237454 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
sbc@chromium.org 78dc9841ff Fix "git cl diff" when run on branch without an issue.
BUG=321279

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@237110 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org d6617f3fcc Fixed URL to "using git" instructions
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@235857 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
digit@chromium.org d6ddc1cb9a Fix "git cl format" when newer clang-format version is installed.
Newer versions of clang-format-diff.py now require a -i flag to
explicitely apply edits, otherwise they just print a diff, which
make "git cl format" a no-op.

This patch fixes the issue by probing the script's help text to
see if the flag is needed. If it is, it is added automatically.

BUG=NONE
R=maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@231020 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
teravest@chromium.org d79d4b8e1b Make "git cl issue 0" idempotent.
Currently, running "git cl issue 0" in a client prints a confusing error
message if there's no issue assigned. This changes the code so that the issue
number isn't "unset" if it's not currently set.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@230499 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
qsr@chromium.org 1ef44afbb4 Adding --directory option to git cl patch
Review URL: https://codereview.chromium.org/27316002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@228926 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
marq@chromium.org e5e5900f49 Fix spelling error in help text.
BUG=

Review URL: https://chromiumcodereview.appspot.com/25808003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@226611 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
tyoshino@chromium.org 99918abbe7 Ignore CC_LIST when private flag is specified.
This prevents private CLs to be automatically CC-ed to public mailing lists
unintentionally.

Review URL: https://chromiumcodereview.appspot.com/24257014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@225925 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
adam.treat@samsung.com 16d2ad682e Add a flag for clang-format that instructs the tool to strip 0 leading slashes from the file names.
I have clang-format-3.3 installed and it appears to default to stripping one leading slash.

BUG=294188

Review URL: https://chromiumcodereview.appspot.com/24217002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@225705 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
sbc@chromium.org 87b9bf026a Add 'git cl diff' command.
This command shows the differences between local branch
and the last patch uploaded to rietveld. The idea being
that you can see what would be uploaded before you actually
upload.

This can useful when using 'git cl patch' to move changes
between checkouts and working from more than one machine at
once.

Review URL: https://chromiumcodereview.appspot.com/24276008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@225552 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ikarienator@chromium.org faf3fdf736 An interactive tool to help find owners covering current change list.
BUG=77248

Review URL: https://chromiumcodereview.appspot.com/12712002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@224264 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
agable@chromium.org 42c2079a1e Fix R= line rewriter to handle TBRs well.
R=maruel@chromium.org, thakis@chromium.org
BUG=253589

Review URL: https://chromiumcodereview.appspot.com/23072039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@222801 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 39c0b22fd3 Convert gclient to use subcommand.py
Update subcommand to support examples, always disable format_description and
format_epilog and add colors when enabled.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/22824018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@218180 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 0633fb4ff2 Split generic subcommand code off its own module.
Use the code in git_cl.py, since it was the more evolved. Add documentation
and clean up the structure along the way.

This makes it possible to easily reuse the generic subcommand handling code.

As a first step, only git_cl.py is using it. Eventually, gclient and gcl could
be switch over.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/23250002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@218072 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
agable@chromium.org eec3ea3534 Pretty-print the CL description during commit.
Having "Description: u'Foo\nBUG=1234\nR=bar@chromium.org\nReview Url: baz'"
is not actually that useful in my experience. I'd rather be able to easily
read the final CL description that is being committed.

Review URL: https://chromiumcodereview.appspot.com/23185006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@217834 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org 36e420ba8b Always use latest patchset in git-cl try
Rietveld rejects tryjobs from non-latest patchsets anyway,
change logic to always use latest patchset.

R=iannucci@chromium.org

Review URL: https://chromiumcodereview.appspot.com/22415012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@216023 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
mdempsky@google.com c3b3dc0183 allow running "git cl format" from subdirectories
BUG=

Review URL: https://chromiumcodereview.appspot.com/22308002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@215724 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 911fce143c Explicitly convert issue and patchset to int.
upload.py returns them as string, eventually leading to a crash.

R=iannucci@chromium.org
BUG=265546

Review URL: https://chromiumcodereview.appspot.com/21020008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@214247 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 885f65199c Disable colors if not a tty.
Otherwise this breaks git cl unit tests.

Update references to 'git cl' in git cl smoke tests to $GIT_CL.

TBR=ilevy@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/20888002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@214019 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
iannucci@chromium.org d9c1b20095 Revert "Revert "Improve description layout. Improve coloring and add legend in help.""
This reverts commit c0594f37a1.

Because I reverted the wrong thing >_<

TBR=maruel@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/20199002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213551 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
iannucci@chromium.org c0594f37a1 Revert "Improve description layout. Improve coloring and add legend in help."
This reverts commit 44a82fa84b.

Broke git cl apply <issue>

TBR=maruel@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/20131006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213545 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 44a82fa84b Improve description layout. Improve coloring and add legend in help.
Convert monkey patching to class inheritance for OptionParser usage in:
commit_queue.py, gclient.py and trychange.py.

Monkey patching confuses the hell out of pylint.

R=jochen@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/19552004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213423 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
jochen@chromium.org a26e04734b Correctly pass the issue number as "issue" parameter to Changelist ctor
Instead of as branchref. Because it's an issue. Not a branchref.

Also, add myself as owner.

BUG=none
R=maruel@chromium.org

Review URL: https://chromiumcodereview.appspot.com/19997004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213387 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 1033efd0da Add color support to git cl and fetch issue properties in parallel.
Add cache for issue properties.

Add --fast option in case the HTTP requests become an issue.

Everyone loves colors:
- White means no issue is associated with the branch.
- Red means no email was sent to request a review. Also red if the issue doesn't
  exist anymore.
- Blue means the issue was not LGTM'ed yet.
- Green means the issue was LGTM'ed and is likely ready to commit or be CQ'ed.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/19967004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213265 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org e25c75b0ba Cleanup 'git cl status' in preparation to add new features.
Reduce the number of conditions and use more early exits to reduce the number of
code paths.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/19463011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213173 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org cf0877805e Simplify code; no need to pass issue arg to GetApprovingReviewers().
The class already knows the issue number.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/19976002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@213083 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
ilevy@chromium.org cc56ee4cac Fix pylint presubmit failure
Caused by crrev.com/210695

TBR=maruel@chromium.org

Review URL: https://chromiumcodereview.appspot.com/19027002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210949 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
tapted@chromium.org 6a0b07c12a Default to using --3way when using `git cl patch` with git >= 1.7.12
Git introduced a --3way argument to `apply` in version 1.7.12 [1]. This
provides a much nicer way to apply issues from Rietveld.

After this change, `git cl patch` will add --3way after checking the git
version for support.

[1] f247b10aa0

BUG=None
TEST=Ran `git cl patch <issue>` with both clean and unclean patches,
also checked behaviour of --reject is preserved.
R=maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210695 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
bratell@opera.com 82b91cd1a8 Replace --no-pager with GIT_PAGER=cat
--no-pager looks ugly in logs and output and makes commands harder to
read. Setting an environment variable is better.

This is a followup to https://chromiumcodereview.appspot.com/14104005/
which added --no-pager.

Review URL: https://chromiumcodereview.appspot.com/18173003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@210503 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
hinoka@google.com 55c05c94c6 Fixes depot_tools presubmit
basic.sh expects "work: None", but "work: " is printed instead, which breaks
presubmit.  This fixes it.

BUG=
R=dpranke@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@208799 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
dbeam@chromium.org 015fd3d953 Make git cl status spit out URLs instead of just Rietveld issue numbers.
R=maruel@chromium.org
BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/17379008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@207048 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 967c0a8f79 Make git cl smarter about subcommands typos.
Look for either a unique prefix or for an approximation of the shortest
Levenshtein distance. So all of these will resolve to 'git cl upload':
  git cl upl
  git cl uplaod

These won't resolve:
  git cl up     # it shares prefix with 'upstream'
  git cl uplao  # not similar enough

Also align help against longest command instead of hard coded '10'. The help
page was distorded.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/17272002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@206820 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
brettw@chromium.org b65c43c671 Add the option to bypass watchlists.
I have a large rename change and it's impossible to upload because the size of the CC field is above the maximum 2000 characters in Reitveld.

Review URL: https://chromiumcodereview.appspot.com/16366008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@205323 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
tapted@chromium.org 0bdc2650d4 Revert 204671 "Default to using --3way when using `git cl patch`."
> Default to using --3way when using `git cl patch`.
> 
> Resolving conflicts is much more fun this way.
> 
> BUG=None
> TEST=Ran `git cl patch <issue>` with both clean and unclean patches, also checked behaviour of --reject is preserved.
> R=maruel@chromium.org
> 
> Review URL: https://codereview.chromium.org/16211005

TBR=tapted@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@204978 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
tapted@chromium.org 61aa0aec1b Default to using --3way when using `git cl patch`.
Resolving conflicts is much more fun this way.

BUG=None
TEST=Ran `git cl patch <issue>` with both clean and unclean patches, also checked behaviour of --reject is preserved.
R=maruel@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@204671 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
alancutter@chromium.org bd1073ebe6 Change to 72 column reference in git cl upload message
76 columns is fine for most patches but reverts will eat another
4 spaces in indentation. For the sake of revert clarity this reference
line is reduced to 72 columns.

Review URL: https://chromiumcodereview.appspot.com/16152005

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