App-GitGerrit
view release on metacpan or search on metacpan
bin/git-gerrit view on Meta::CPAN
First, git-gerrit tries to get credentials from the
C<git-gerrit.baseurl> configuration variable. The URL should be in a
format like C<https://username:password@host/path>. Security conscious
people should avoid putting credentials there, but if you do
git-gerrit will be satisfied.
Then, git-gerrit tries to load Perl's L<Net::Netrc> module, if
available, to get credentials from a C<netrc(5)> file.
As a last resort, git-gerrit tries to load Perl's L<Term::Prompt>
module to prompt you for the credentials.
If none of this works, git-gerrit dies screaming.
=head1 BASH COMPLETION
If you use bash and have L<bash completion enabled for
Git|http://git-scm.com/book/en/Git-Basics-Tips-and-Tricks> you may
also enable it for git-gerrit by sourcing the
F<etc/bash_completion.d/git-gerrit> script that comes with
L<App::GitGerrit> distribution. You may do it in your F<~/.bashrc>
lib/App/GitGerrit.pm view on Meta::CPAN
($username, $password) = ($mach->login, $mach->password);
}
} else {
debug "Failed to require Net::Netrc";
}
}
unless (defined $username && defined $password) {
debug "Prompt the user for the credentials";
if (eval {require Term::Prompt}) {
$username = Term::Prompt::prompt('x', 'Gerrit username: ', '', $ENV{USER});
$password = Term::Prompt::prompt('p', 'Gerrit password: ', '');
print "\n";
} else {
debug "Failed to require Term::Prompt";
}
}
defined $username or error "Couldn't get credential's username";
defined $password or error "Couldn't get credential's password";
return ($username, $password);
( run in 1.399 second using v1.01-cache-2.11-cpan-6aa56a78535 )