55 Commits

Author SHA1 Message Date
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
Orgad Shaneh
67ad391ee0 TrivialRebase: Aggregate approvals
Change-Id: I5c07e5e9b879dc3fc0ebbe2b2179f68ff5e763d3
2013-04-11 22:01:52 +03:00
Orgad Shaneh
f18e1e0d2f TrivialRebase: Correctly handle empty patch-id
If only one of the patch-ids is empty, it should not be
considered a trivial rebase

Change-Id: Ie5196bc81d4d3bcdd16572ade265f96c086fabed
2013-04-11 13:41:48 +03:00
Orgad Shaneh
eecfa12b27 TrivialRebase: Support alternative ssh executable
like plink.

Two arguments are added:

--ssh - ssh executable to be used (default: "ssh")
--ssh-port-flag - port flag for ssh (default: "-p")

Since ssh-port-flag receives a flag it can only be
used with --arg=value notation

plink requires "--ssh plink --ssh-port-flag=-P"

Change-Id: I7f494e099de9a9877a3336fcd4e735a9d9dfd921
2013-04-11 07:24:55 +00:00
Orgad Shaneh
5fe0860ca1 TrivialRebase: Add server argument
listenAddress can be bound to any interface, not only localhost

Change-Id: I672ca6b8b762e50ceaa62839786eb8372eab3a8a
2013-04-11 07:23:58 +00:00
Orgad Shaneh
e507cf90e5 TrivialRebase: Make private key argument optional
The argument was used before peer_keys was introduced.

Sharing the server's private key is insecure.
peer_keys should be used to allow administration from other
hosts.

Argument was not removed to maintain backward compatibility.

Change-Id: I0e9f54154c8c48b496230bb6b07ed3bdfe05d2d4
2013-04-11 07:23:13 +00:00
Orgad Shaneh
c9c4272b77 TrivialRebase: Pipe subprocesses directly
Change-Id: Ic45a8752cb2b6f5a1b85835700658a5cd8127369
2013-04-11 07:22:35 +00:00
Orgad Shaneh
0ee021b543 TrivialRebase: Skip unsupported categories
No reason to fail on such cases

Change-Id: I58cf2c119c377a8e525f2dd307d437c56b6dadbd
2013-04-11 07:22:04 +00:00
Orgad Shaneh
a17f23c525 TrivialRebase: Raise exception on error
If previous revision is not found for patchsets greater than 1

Change-Id: Ifb8b16d5be7c984a5a01773320786b56cc3b9e33
2013-04-11 07:21:35 +00:00
Orgad Shaneh
18f50ed920 TrivialRebase: Refactor as a class
And improve input validation

Change-Id: I379b457ac72e13259f73610b199dc8db68e9b369
2013-04-11 05:44:32 +03:00
Orgad Shaneh
a581ad2ad2 TrivialRebase: Fix the fix of pylint error :)
Didn't notice the call to group()

Change-Id: I71a5aa712b3005551182812db9236de93ec1a2b7
2013-04-09 05:48:58 +03:00
Orgad Shaneh
54d646fb7e TrivialRebase: Fix pylint errors
Change-Id: Ief140acdc9975eaecd96781d7d594fb029a94c43
2013-04-08 23:18:19 +03:00
Edwin Kempin
505b427d33 Add theme that displays Diffy on the left side of the top menu
Change-Id: Ic2e125f3d7d19cf5d2b07be6e102c28bc814fe17
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-04-04 17:01:34 +02:00
Orgad Shaneh
1a41273e24 TrivialRebase: Use change-url flag for ChangeId
Change-Id: I90d1586e5e7f483a4e6160401cf8c9d3c080405b
2013-02-19 09:18:03 +02:00
Orgad Shaneh
0f6870f39d TrivialRebase: Adapt options to gerrit 2.6
argparse is now used instead of optparse for parsing command-line
arguments.

This introduces dependency on Python 2.7 (or manual installation of the
argparse module).

Change-Id: I9bf169a15737b3ee21628d52b9ada7c2fc6faab5
2013-02-19 09:18:03 +02:00
David Pursehouse
9e56ab322f Merge "TrivialRebase: Prevent exception for empty commit" 2013-02-19 06:54:06 +00:00
David Pursehouse
4a8613fa25 Merge "TrivialRebase: Use plain python instead of python2.6" 2013-02-19 06:49:23 +00:00
Orgad Shaneh
642acaea63 TrivialRebase: Prevent exception for empty commit
Change-Id: I2c3dc5fb81144bd14feee8dc5f1d2308a11e23d2
2013-01-20 11:46:43 +02:00
David Pursehouse
ea8b627b8d trivial-rebase: Fix pylint errors
W0622: Redefining built-in 'exit'

  It is not necessary to explicitly import the `exit` method
  from the `sys` module.  Remove this import.

W0622: Redefining built-in 'dict'

  Rename the variable `dict` to `data` to prevent redefinition
  of the built-in.

W0612: Unused variable 'gsql_stderr'
W0612: Unused variable 'args'

  Prefix unused variables with `_`.

Change-Id: I6c4f9a54a3a27eab09c419154f9e2ee6689536de
2013-01-18 16:05:54 +09:00
David Pursehouse
b597b3641a Add pylint configuration for contributed Python scripts
The contrib directory contains some Python scripts.

Add the pylint configuration file as used in the git-repo
project, so that it can also be used to check the scripts
here.

Change-Id: I115cf5773b2a9abcb5e760ac8a7999cfebbfdae6
2013-01-16 20:03:23 +09:00
Orgad Shaneh
c7cfce387a TrivialRebase: Use plain python instead of python2.6
Windows installation only has python.exe

Change-Id: I779d8e38be333e7580f00158e1b08166934155a4
2013-01-16 08:37:43 +00:00
Olivier Croquette
4b6de14811 Lightweight LDAP server for debugging
Change-Id: I4550d6e2193f97d317cd3e04fe5808cb2d98229a
2012-12-19 22:28:34 -05:00
Gabriel Lorin
c9a8024246 Spotify theme for gerrit
Change-Id: Iffcec8606b428be88b6bc7cb45113ce457d90ba0
2012-11-13 16:48:19 -08:00