App-GitGerrit
view release on metacpan or search on metacpan
bin/git-gerrit view on Meta::CPAN
Git-gerrit is part of the
L<App::GitGerrit|http://search.cpan.org/dist/App-GitGerrit/>
distribution that you have to download from
L<CPAN|http://search.cpan.org/> and install. There are a few ways to
do it, depending on your environment. Here are a few tips:
=head2 If you cook your own Perl
If you build your own Perl, perhaps using
L<perlbrew|http://perlbrew.pl/>, you know the drill:
cpanm App::GitGerrit
=head2 Debian, Ubuntu, etc.
If you want to use the Perl that comes packaged in your Debian-based
distribution, you can install some git-gerrit dependencies from
packaged perl modules. These are the ones packaged with Ubuntu 12.04:
sudo apt-get install -y \
liburi-encode-perl libhtml-tree-perl libjson-perl \
libscope-guard-perl libcrypt-ssleay-perl libwww-perl cpanminus
The nifty C<cpanm> installer should take care of the remaining
dependencies and of installing C<git-gerrit> for you like this:
sudo su -l -c "cpanm App::GitGerrit"
=head2 RedHat, CentOS, etc.
If you want to use the Perl that comes packaged in your RedHat-derived
distribution, you can install some git-gerrit dependencies from
packaged perl modules. These are the ones packaged with CentOS 6.4:
sudo yum install -y \
perl-URI perl-HTML-Tree perl-JSON perl-Scope-Guard \
perl-Test-Exception perl-Test-use-ok perl-Crypt-SSLeay perl-YAML \
perl-CPAN perl-ExtUtils-MakeMaker
The verbose C<cpan> installer should take care of the remaining
dependencies and of installing C<git-gerrit> for you like this:
sudo su -l -c "cpan App::GitGerrit"
=head2 Windows
On Windows I suggest that you install L<Strawberry
Perl|http://strawberryperl.com/>. Then, open a command line tool and
type this:
cpanm Data::Util App::GitGerrit
Note that on Windows you may have to invoke C<git-gerrit> directly as
B<git-gerrit> and not through Git as B<git gerrit>. This is because
Git will probably use the old Perl that comes bundled with it, not
Strawberry Perl. Your mileage may vary, though.
=head1 CONFIGURATION
Git-gerrit is configured through Git's standard configuration
framework, which you can read about with the C<git help config>
command. All git-gerrit's configuration variables are in the
C<git-gerrit> section and can be created at the C<system>, the
C<global>, or the C<local> level. More specifically, git-gerrit groks
its configuration from the output of the C<git config -l> command.
=head2 Git and Gerrit access
In order to interact with Gerrit, git-gerrit has to know three things
which it can usually infer from your default Git configuration, but
that you may be explicit about using these Git configuration
variables:
=over
=item * B<git-gerrit.remote>
Whenever git-gerrit invokes a Git command to interact with Gerrit
(e.g., git-push and git-fetch) it refers to Gerrit using a remote
name. You probably already have a remote configured for Gerrit. If you
don't, git-gerrit assumes the name C<origin> by default.
You can check your Git remotes by issuing the command C<git remote
-v>. Note that the remote's URL must use the HTTP or (better yet)
HTTPS protocol, not SSH.
=item * B<git-gerrit.baseurl>
This is the value of the
L<gerrit.canonicalWebUrl|https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#_a_id_gerrit_a_section_gerrit>
variable configured in the C<etc/gerrit.config> file at Gerrit's
server. It's needed so that git-gerrit can interact with Gerrit's REST
API.
If you don't specify it, git-gerrit assumes that it is equal to the
remote's URL minus the path.
This usually can be configured globally, if you have a Gerrit server
hosting several of your repositories.
It's a good idea to have your username in this URL to avoid being
asked for it interactively.
=item * B<git-gerrit.project>
This is the name of the project associated with the Gerrit
repository. It's needed so that git-gerrit can interact with Gerrit's
REST API.
If you don't specify it, git-gerrit assumes that it is equal to the
path of the remote's URL stripped of any path in
C<git-gerrit.baseurl>.
=back
This is designed so that for most Gerrit instances git-gerrit should
work out of the box, without any explicit configuration.
For example, if you're working on Android's
L<kernel|https://android-review.googlesource.com/#/admin/projects/kernel/common>
project, you may clone it with the suggested command:
( run in 0.657 second using v1.01-cache-2.11-cpan-e1769b4cff6 )