git-review/git_review/tests
Jeremy Stanley d633541ecc Vendor a copy of Gerrit's commit-msg Git hook
Gerrit wants each commit message to include a unique identifier
string in a special footer line, so provides a commit-msg hook to
randomly generate and insert one. Traditionally, this file is served
directly from each Gerrit server and users retrieve it via SCP or
HTTPS to install a local copy in their clone of every repository.

Retrieving this file over the network has historically presented a
number of challenges: modern OpenSSH has deprecated the SCP protocol
while the mina-sshd library Gerrit uses hasn't implemented
compatible SFTP support, authentication failures can shadow some
clearer error handling later in git-review's workflow leading to
confusing error messages, and then there are the security concerns
with needing to trust the Gerrit server to supply a script which
will end up running locally on the developer's machine.

In order to address these problems, making git-review more robust
and secure, we embed a copy of the Gerrit upstream project's
commit-msg hook in the client itself and write that to disk by
default rather than pulling a remote copy. This approach does mean
that the user will end up with a frozen version of the script
contemporary with the git-review release they've installed (but its
function is simple and the implementation has changed very
infrequently). It may also break workflows for sites which rely on
users retrieving a customized commit-msg hook. For those reasons, a
command-line option is provided to restore the prior behavior.

Change-Id: Ia26abc781a281817115cb1cafcd5e7b78b383e39
2024-03-04 23:14:16 +00:00
..
__init__.py Test old and new Gerrit 2023-03-14 08:08:22 -07:00
check_test_id_hashes.py trivial: Update to hacking 2.x 2020-01-16 15:12:58 +00:00
prepare.py trivial: Update to hacking 2.x 2020-01-16 15:12:58 +00:00
test_git_review.py Vendor a copy of Gerrit's commit-msg Git hook 2024-03-04 23:14:16 +00:00
test_unit.py Uncap test requirements 2023-09-20 15:05:25 +00:00
utils.py Fix flake8 issue 2024-01-29 09:09:47 -08:00