77 Commits

Author SHA1 Message Date
Dave Borowitz
292fa154c1 Format all Java files with google-java-format
Having a standard tool for formatting saves reviewers' valuable time.
google-java-format is Google's standard formatter and is somewhat
inspired by gofmt[1]. This commit formats everything using
google-java-format version 1.2.

The downside of this one-off formatting is breaking blame. This can be
somewhat hacked around with a tool like git-hyper-blame[2], but it's
definitely not optimal until/unless this kind of feature makes its way
to git core.

Not in this change:
* Tool support, e.g. Eclipse. The command must be run manually [3].
* Documentation of best practice, e.g. new 100-column default.

[1] https://talks.golang.org/2015/gofmt-en.slide#3
[2] https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
[3] git ls-files | grep java$ | xargs google-java-format -i

Change-Id: Id5f3c6de95ce0b68b41f0a478b5c99a93675aaa3
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
2017-02-07 10:04:39 +09:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
David Pursehouse
3336c2de13 Remove unused/outdated Pylint configuration file
This configuration file is not in sync with the latest version
of pylint, and is not (as far as I am aware) being used by anyone.

Change-Id: Ia397f359f6ccd72244586f960e5b3c7838c68f54
2016-10-20 09:07:01 +09:00
Alice Kober-Sotzek
28deb034d0 Improve populate-fixture-data script
The script generated only users with the same first name. In
addition, only one change was created per user. In order to be able to
test whether users can be found by their first name, different first
names are used now. For each of those users, 1 to 5 changes are
created to reflect a more natural user base, on which statistics
don't yield the same values for all users. As we don't want to
possibly specify valid gmail accounts, we use another suffix for the
email address.

Change-Id: Ieea72bb45a374eebaa2c51ec74789b337f256958
2016-10-10 10:51:07 +02:00
Dave Borowitz
e7d88cd8f0 git-push-review: Handle reviewers with no explicit config
This "or r" was accidentally removed in I5ad5b617.

Change-Id: If4419e204b54e619559ed2a2a25c508fc2367d35
2016-10-04 11:48:17 -04:00
David Pursehouse
77abe31431 abandon_stale: Use pygerrit2 instead of pygerrit
Change-Id: I2cd6149800368e02805e60b854bc86604cce405f
2016-09-23 08:51:05 +02:00
Dave Borowitz
053b7a6ee0 git-push-review: Support #hashtag arguments
Change-Id: I5ad5b61720ca4854ea61390be209c7357b66d669
2016-09-22 09:21:36 +02:00
Patrick Hiesel
13ebf8cb6d Add a piece of go code to find mismatching lib versions in bzl/bck
Tested with:
go run contrib/build-consistency.go

Gives (before the current fix on master):
SHA1 of lib gson does not match: buck has
751f548c85fa49f330cecbb1875893f971b33c4e while bazel has
f1bc476cc167b18e66c297df599b2377131a8947
SHA1 of lib jsr305 does not match: buck has
f7be08ec23c21485b9b5a1cf1654c2ec8c58168d while bazel has
516c03b21d50a644d538de0f0369c620989cd8f0
SHA1 of lib auto_value does not match: buck has
b764e0fb7e11353fbff493b22fd6e83bf091a179 while bazel has
6873fed014fe1de1051aae2af68ba266d2934471
SHA1 of lib junit does not match: buck has
dc7edb9c3060655c7fb93ab9b9349e815bab266f while bazel has
4e031bb61df09069aeb2bffb4019e7a5034a4ee0
SHA1 of lib joda_time does not match: buck has
1c295b462f16702ebe720bbb08f62e1ba80da41b while bazel has
9f2785d7184b97d005a44241ccaf980f43b9ccdb
SHA1 of lib joda_convert does not match: buck has
675642ac208e0b741bc9118dcbcae44c271b992a while bazel has
35ec554f0cd00c956cc69051514d9488b1374dec
Can't parse lib sha1/name on target
maven_jars(name='lucene_core_and_backward_codecs',
srcs=[':backward_codecs_jar',':lucene_core',],visibility=['PUBLIC'],
SHA1 of lib lucene_core does not match: buck has
a74fd869bb5ad7fe6b4cd29df9543a34aea81164 while bazel has
c52b2088e2c30dfd95fd296ab6fb9cf8de9855ab
SHA1 of lib lucene_analyzers_common does not match: buck has
1e0e8243a4410be20c34683034fafa7bb52e55cc while bazel has
c2aa2c4e00eb9cdeb5ac00dc0495e70c441f681e
SHA1 of lib lucene_misc does not match: buck has
504d855a1a38190622fdf990b2298c067e7d60ca while bazel has
95f433b9d7dd470cc0aa5076e0f233907745674b
SHA1 of lib lucene_queryparser does not match: buck has
0fddc49725b562fd48dff0cff004336ad2a090a4 while bazel has
dccd5279bfa656dec21af444a7a66820eb1cd618
SHA1 of lib ow2_asm does not match: buck has
5ef31c4fe953b1fd00b8a88fa1d6820e8785bb45 while bazel has
dcc2193db20e19e1feca8b1240dbbc4e190824fa
SHA1 of lib ow2_asm_analysis does not match: buck has
6d1bf8989fc7901f868bee3863c44f21aa63d110 while bazel has
c7126aded0e8e13fed5f913559a0dd7b770a10f3
SHA1 of lib ow2_asm_commons does not match: buck has
25d8a575034dd9cfcb375a39b5334f0ba9c8474e while bazel has
a7111830132c7f87d08fe48cb0ca07630f8cb91c
SHA1 of lib ow2_asm_tree does not match: buck has
87b38c12a0ea645791ead9d3e74ae5268d1d6c34 while bazel has
287749b48ba7162fb67c93a026d690b29f410bed
SHA1 of lib ow2_asm_util does not match: buck has
b60e33a6bd0d71831e0c249816d01e6c1dd90a47 while bazel has
1512e5571325854b05fb1efce1db75fcced54389

Change-Id: I536b3eecf61a2cd1e7ce9d1c19335f1c2238b6c5
2016-08-26 17:01:50 +02:00
Patrick Hiesel
c8076c301b Added a script to populate some dummy data
This is just a first version of a py script that
populates a Gerrit instance with some data for
local monkey testing. I'll add some more sugar to
it when I have more time.

Change-Id: I49ecf1ce4f288c5f07254a445a7168cbf83ea2f2
2016-05-20 17:31:47 +00:00
Richard Fearn
626327ccae Add "threads" command to gerrit.sh bash_completion script
The command was added to gerrit.sh in commit ed819f30bc in change
I92b75d1ed.

Change-Id: Iba9cfd73f49390b9c89f07098d5c239a28429459
2016-03-23 17:40:35 +00:00
Sebastian Schuberth
f8602e1cab Add the original SVG images for the Diffy logo
People who would like to use the Diffy logo in their third-party
application for Gerrit probably would start looking for the original logo
sources in the Gerrit repository instead of the discussion group. So copy
the SVG images from [1] to the repository.

[1] https://groups.google.com/d/msg/repo-discuss/nLCvwG2POpM/ENLsQX3ldugJ

Change-Id: Ia9877d9c0a67a1a8c233d9bc49acd1ea3184f9a8
2016-03-16 10:30:46 +01:00
David Pursehouse
fa1a8280fe Merge "Don't hardcode bash location" 2016-02-26 00:15:57 +00:00
David Pursehouse
a55ed3dba4 abandon_stale.py: fix typo in option handling
Change-Id: I8950cd26fa852a394b1984e52b0f74092d6f8db5
2016-02-15 08:21:57 +00:00
David Pursehouse
0198978dc5 abandon_stale.py: Allow to limit by branch and project
Change-Id: Id73923c17ecfc62cb4b911dfbee793a4c9102a7d
2016-02-01 10:38:12 +09:00
Doug Kelly
920b1667d4 Correct issue with Bouncy Castle code signing
If the Bouncy Castle Crypto libraries are unsigned, issues result with
the Eclipse build, since they rely on the copy that exists in the
libraries copied by the download_file.py script.  As a workaround, use
a genrule in ConvertKey to unsign the JARs manually.

Change-Id: I44d6ad5b05a18258e8bf5400c42f1cbd159e59b2
2015-11-10 13:00:26 -08:00
Doug Kelly
1cbfe97c91 Changing the SSH key converter to BUCK
Since we're a BUCK shop, convert the SSH key converter accordingly.
This requires we mark Bouncy Castle as unsign, even though we
do not include this in our normal Gerrit builds.  Also, we had to
add slf4j-nop, since this app doesn't require logging.

Change-Id: I85031192f9172a90512d5f28cf1621c10ad6ebf4
2015-11-09 10:59:32 -08:00
Doug Kelly
bd3b9958a6 Simple tool for converting SSH keys
If SSH keys are created without Bouncy Castle, the keys are stored in
a non-standard format. These can be read back in and converted back to
standard OpenSSH format through the use of this tool.  This may be used
by anyone trying to support new key types after installing Bouncy
Castle.

Change-Id: I52c00fcd44a55c855b5e3a6ebac1283f860e08b8
2015-11-09 10:04:07 -08:00
Dan McGregor
26c0d09bfd Don't hardcode bash location
bash may not be installed in /bin, so don't make that assumption.

Change-Id: I04ae786c7558f829ddf9649c127cbba1457dcfd3
2015-08-26 09:03:24 -06:00
David Pursehouse
25bebb136b abandon_stale: Allow singular form of age parameter
Change-Id: I87396d6fd223f930e46a85c7f67419c0e2b74b4f
2015-07-06 12:12:28 +09:00
David Pursehouse
e766d2ca37 abandon_stale: Allow weeks as an age parameter
Change-Id: I206a3b137fa5cf69f9b8a54541cf32c16a372d83
2015-07-06 12:09:52 +09:00
David Pursehouse
522e4f8bd4 Script to abandon stale changes from the review server
Fetches a list of open changes that have not been updated since a
given age (default 6 months), and then abandons them.

Assumes that the user's credentials are in the .netrc file.  Supports
either basic or digest authentication.

Example to abandon changes that have not been updated for 3 years:

 ./abandon_stale --gerrit-url http://review.example.com/ --age 3years

Supports dry-run mode to only list the stale changes but not actually
abandon them.

Requires pygerrit (https://github.com/sonyxperiadev/pygerrit).

Change-Id: Ie0edb54847f9f2ab8204647e17e3893ed0a057ea
2015-06-30 14:02:00 +00:00
Björn Pedersen
c357cebdae tools: use python on path
Use the canonical syntax to specify the python executable to use.

Avoids a fatal error if /usr/bin/python is a too old version (< 2.7).

Change-Id: I3e8affb52be993d35c0dcf90774d962a59ef5635
2015-06-18 17:10:11 +02:00
David Pursehouse
686bfea7b3 Fix minor python code style issues
Fix some minor issues that were reported by pyflakes and pylint.

- Rename arguments to prevent redefinition of built-in 'dir'
- Rename method call to prevent redefinition of built-in 'help'
- Remove unused imports
- Prefix unused variable with underscore to prevent warning

Change-Id: Ia9e21c0f1a69af43f6e4566be46c31bdda540d2f
2014-12-18 02:51:06 +00:00
Dave Borowitz
1b46d67a93 contrib: Add a simple tool for pushing to named reviewers
This is a sort of simplified version of git-review[1] for users like
myself who don't mind most git command line tools, and therefore don't
feel the need to switch to a full git-review workflow, but still don't
like the HEAD:refs/for/master%r=user@domain.com syntax for specifying
reviewers during a push.

Reviewer aliases can be specified in a git config file:

[reviewer]
  sop = sop@google.com

$ git push-reviewer --dry-run sop
git push origin HEAD:refs/for/master%r=sop@google.com

[1] http://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: Ib0c8d609ed9eab17b71ddb13da417a9bfd013611
2014-11-06 14:42:37 -08:00
Edwin Kempin
5ba27bdc38 Allow to download reposize.sh script from Gerrit
Change-Id: Ic8d81a64a89fe0046fccc13e7892acbe52c55bc4
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-05-09 16:20:51 +02:00
Matthias Sohn
61bc05e461 Fix documentation and add license header for reposize.sh
Change-Id: I474f9a800443fcaa76c764132c25b6aab7342999
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-04-29 13:26:43 +02:00
Matthias Sohn
2d1c219aa3 Add script to find the largest objects in the pack files of a repo
This script is useful if an existing history should be pushed into a
Gerrit project but the push fails because the server has a max object
size limit configured and the existing history contains objects that
are too large. The script helps to identify the large objects so that
they can be removed from the history by using the 'git filter-branch'
command, or so that the limit can be increased.

Change-Id: I99d21d76ac204bf9b53fd589c0ffcbeee2e02422
2014-04-25 07:14:40 +02:00
Orgad Shaneh
5cf13de9db Remove the trivial_rebase hook
Implemented in core, no longer needed

Change-Id: Ibc27c8d2ea6357e04d1d475bd45ffac8b26e41be
2014-02-06 07:45:17 +02:00
Colby Ranger
00e5dc600b Add contrib/ui-api-proxy.go for testing UI features with live data.
ui-api-proxy is a reverse http proxy that allows the UI to be served from
a different host than the API. This allows testing new UI features served
from localhost but using live production data.

Change-Id: I1cef74c995ac21f4310c5ced4c042ece59a1a8e8
2013-12-18 09:07:02 -08:00
alex
85dfa35f6c Recompression *.png images with pngout tool to reduce the size of files
Change-Id: I1f0db0802ca8c554abdcc1e0a9733539e8700896
2013-11-03 14:33:54 +00:00
David Pursehouse
9d62c20c52 Improve the bash completion script installation instructions
Change-Id: I186fe3a080ef7c8cd06752e5766f506dd56d2e1b
2013-09-27 10:18:30 +09:00
David Pursehouse
3c08243c50 Add bash completion script for gerrit.sh
The script provides tab-completion in the bash shell for the gerrit.sh
script.

It can be invoked on a per-shell basis, or included in the user's bash
profile to be made available on every login.

Change-Id: I7f8afb8885d42c30df909a0520a0c736b8735fb4
2013-08-22 16:18:42 +09:00
Shawn Pearce
c0d850928a Merge branch 'stable-2.7'
* stable-2.7:
  Say in gsql documentation that 'Access Database' capability is required
  TrivialRebase: Replace category_id with label
  TrivialRebase: Avoid re-adding -2 for code-review label
  TrivialRebase: Support custom labels
  Fix test skipping flag
  Release notes for Gerrit 2.6.2
  Fix NullPointerException when comparing AccessSections

Conflicts:
	ReleaseNotes/index.txt
	tools/release.sh

Change-Id: I3babf1752a7c822fc1c3599643308959bb1da7ec
2013-08-06 11:34:13 -07:00
Orgad Shaneh
f859e62e9b TrivialRebase: Replace category_id with label
terms have changed in 2.6. schema still hasn't.

Change-Id: I1003d420fcd5b2f56b9c1dc7955f761c37253dc5
2013-07-29 16:12:32 +00:00
Orgad Shaneh
02b672eea3 TrivialRebase: Avoid re-adding -2 for code-review label
Change-Id: I35dadcce6e151ccbbabe4d443262ff8e2b457f3e
2013-07-25 21:57:50 +03:00
Orgad Shaneh
4af8c8ff61 TrivialRebase: Support custom labels
Change-Id: I99c8979725ced1a6191d4a5f94ab70378c5b260d
2013-07-25 20:35:53 +03:00
Shawn Pearce
a7b2435800 Adjust diffy theme to fix ChangeScreen2 overlap
The diffy theme was causing the overlap observed with the top of
ChangeScreen2 sitting on the bottom of the menu.  Adjust the position
of Diffy slightly to fix this.

Change-Id: I8129fb30bea9e5066395d764c59ca59d64411576
2013-07-16 17:26:51 -07:00
Brian Harring
c068f3343e git-exproll.sh: Return nonzero on errors.
This script needs a bit more analysis to make sure all pathways
are covered, but this CL fixes an obvious path.

Change-Id: I2a8404b7a6eecd5cedba3daa20f63917a8d18482
2013-05-24 15:20:56 +09:00
David Pursehouse
2e082bf215 Add configuration file for PEP-8 checker tool
The PEP-8 checker tool (pep8.py) [1, 2] is used to check that Python
scripts follow the Style Guide for Python Code [3].

This change adds a configuration file for that tool.  The configuration
overrides the defaults for the following settings:

To make it easier to see what's wrong, enable:

  - Quote the lines on which violations are found
  - Quote the relevant section of the PEP-8 guideline

The maximum line length according to PEP-8 is 80 characters, but for
some reason the checker defaults to 79, therefore:

  - Set maximum line length to 80 characters

According to PEP-8, code should be indented at 4 characters, but the
Google Python Style Guide [4] says 2.  Code in Gerrit follows the
Google style, so:

  - Disable warnings "Indentation is not a multiple of four"

The configuration is invoked with the --config option when running
the check tool:

  $ pep8.py --config ./contrib/.pep8rc myfile.py

[1] https://github.com/jcrocholl/pep8
[2] https://pypi.python.org/pypi/pep8
[3] http://www.python.org/dev/peps/pep-0008/
[4] http://google-styleguide.googlecode.com/svn/trunk/pyguide.html

Change-Id: If02dd9e51cf3a6e0c0238e78bcfad1d7081de742
2013-05-17 14:35:47 +09:00
Chirayu Desai
4c5ee48f47 Python3 support
* Mostly involves changing print to be a function, and adding
  "from __future__ import print_function" for copatibility.

Change-Id: I3129233726e0116a348753a2e2bb68806a08668c
Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
2013-05-13 14:07:42 +05:30
David Pursehouse
c56875df8f TrivialRebase: tidy up docstrings to follow PEP-0257
Tidy up the docstrings to follow PEP-0257 [1], the Python
Docstring Convention.

The following warnings, reported by the pep257 checker [2], are
removed.

- All modules should have docstrings.
- Multiline docstring should end with 1 blank line.
- First line should be in imperative mood ('Do', not 'Does').
- First line should end with a period.

[1] http://www.python.org/dev/peps/pep-0257/
[2] https://github.com/GreenSteam/pep257

Change-Id: Icdda650d77c3b52c6b4dba62467b45ade8229b48
2013-04-30 22:49:34 +09:00
Edwin Kempin
e6d06d77f5 Make Diffy in Diffy theme smaller
Shrink the Diffy logo in the Diffy theme so that it doesn't consume
more vertical space than the header menu.

This now matches the theme that is used on
gerrit-review.googlesource.com.

Change-Id: I943253a24bf1e4ab8a74c23d68df8ea3fd18d115
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-04-25 09:14:29 +02:00
Orgad Shaneh
6f4e9e8645 TrivialRebase: Fix custom categories
local var was replaced with a member, adapt

Change-Id: Ie1a8a1f899fc54f8c8422a612e17d990bc544788
2013-04-23 16:01:56 +03:00
David Pursehouse
a4bc8dfb06 Merge "TrivialRebase: Support custom labels" into stable-2.6 2013-04-21 14:17:17 +00:00
David Pursehouse
baa1432f81 Merge "TrivialRebase: Call gerrit review instead of approve" into stable-2.6 2013-04-20 05:13:25 +00:00
Orgad Shaneh
f51cb9a58a TrivialRebase: Support custom labels
Change-Id: I7352ecb48e78fd1c74c3fb00fe05429ce8f5eb77
2013-04-19 18:12:11 +03:00
Orgad Shaneh
7d3f63c3b6 TrivialRebase: Call gerrit review instead of approve
approve is deprecated

Change-Id: I7653213ba0f9835cf6cfb7639cfeeb37b20e10f4
2013-04-18 12:35:15 +03:00
Orgad Shaneh
5a9fdc3f77 TrivialRebase: Adapt to labels in 2.6
Change-Id: If0706a17df1e25874e3b7717a7eea00be3f47d68
2013-04-18 09:25:53 +03:00
Orgad Shaneh
0c68ab93be TrivialRebase: Exclude Code-Review-2
It is copied without the hook

Change-Id: I1881812ecd07e51cfce81a065321ad60a27c39b2
2013-04-18 08:21:59 +03:00
David Pursehouse
3e6ce23664 Merge "TrivialRebase: Aggregate approvals" into stable-2.6 2013-04-18 00:10:43 +00:00