[TYPO3-core] gerrit-tools

Steffen Gebert steffen.gebert at typo3.org
Sun May 1 21:37:12 CEST 2011


while searching for some tools to improve the work with gerrit, I 
stumbled over "gerrit-tools" [1].

I played a bit with it today and think it eases some things.

Identified by the gerrit change number (the small integer), you can get 
the most recent patch for a change (it creates a branch "rID" 
automatically), approve it, and throw the branch away.
You can also show the diff between two patch sets (which works in the 
gerrit UI only per file).

As it seems to have some problems with our pushinsteadof configuration, 
I forked the repository. You can grab it here, if you want [2]

[1] https://github.com/indirect/gerrit-tools
[2] https://github.com/StephenKing/gerrit-tools

Help output of git-review:
> $ git-review -h
> Usage: git-review [<options>] push [<change number>]
>    or: git-review [<options>] <change number>
>    or: git-review [<options>] reset
>   -h  --help                  Show this message
>   -v  --verbose               Show all commands before running them (default: on)
>   -q  --quiet                 Don't display commands before running them (default: off)
>   -e  --explain  --dry-run    Don't actually run commands (default: off)
>   git-review assists in code reviews with gerrit, both pushing or pulling changesets to review.
>   push [<change number>]
>     Pushes a single patch to gerrit for review. If your HEAD is a tracking branch
>     git-review will reset it to the remote branch after successfully pushing the changeset.
>     If you are working on a non-tracking branch, that branch will be left alone.
>     Given a change number, the current patch will replace the existing one, following
>     the same reset rules as above.
>     NOTE: If the BROWSER environment variable is set, the Gerrit page for the pushed
>     change will be opened in that browser (e.g. 'open' or '/usr/local/bin/firefox').
>   <change number>
>     Applies the latest patch for the change at <change number> on top of the current
>     branch, if it's a tracking branch, or master on a branch named for <change number>,
>     allowing you to review the change.
>   update
>     Updates the review branch that you're currently on to the latest patch.
>   approve
>     Approves the current patch but does not merge it.
>   reset
>     Removes the current change branch created by the 'start' subcommand and switches
>     back to master.
>   diff <change number> [<patch number> <patch number>]
>     Displays a diff of the last two patches applies to the given changeset, or between
>     the given patches of that changeset.
>   rebase [<change number>]
>     Rebases the latest patch for a given change number (or the current change branch)
>     against master, then submits it as a new patch to that change. This helps deal with
>     Gerrit's "Your change could not be merged due to a path conflict" error message.
>   open
>     Opens the currently checked-out Gerrit change's page in the browser (given by the
>     BROWSER environment variable).

Kind regards

Steffen Gebert
TYPO3 v4 Core Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

More information about the TYPO3-team-core mailing list