diff options
author | Mike Frysinger <vapier@google.com> | 2016-08-15 21:23:44 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2016-08-16 13:02:52 -0400 |
commit | 40252c20f75188147558c0135bf71de907e01442 (patch) | |
tree | d20ffbc8160430782680e10ce121b678cdc8e940 /subcmds | |
parent | 69297c1b771bbbd05b63e965a524de6860d15d8c (diff) | |
download | git-repo-40252c20f75188147558c0135bf71de907e01442.tar.gz |
RepoHook: allow users to approve hooks via manifests
The constant prompting when registered hooks change can be tedious and
has a large multiplication factor when the project is large (e.g. the
AOSP). It gets worse as people want to write more checks, hooks, docs,
and tests (or fix bugs), but every CL that goes in will trigger a new
prompt to approve.
Let's tweak our trust model when it comes to hooks. Since people start
off by calling `repo init` with a URL to a manifest, and that manifest
defines all the hooks, anchor trust in that. This requires that we get
the manifest over a trusted link (e.g. https or ssh) so that it can't
be MITM-ed. If the user chooses to use an untrusted link (e.g. git or
http), then we'll fallback to the existing hash based approval.
Bug: Issue 226
Change-Id: I77be9e4397383f264fcdaefb582e345ea4069a13
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/upload.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 674fc17d..4b05f1e8 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -456,7 +456,9 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
456 | 456 | ||
457 | if pending and (not opt.bypass_hooks): | 457 | if pending and (not opt.bypass_hooks): |
458 | hook = RepoHook('pre-upload', self.manifest.repo_hooks_project, | 458 | hook = RepoHook('pre-upload', self.manifest.repo_hooks_project, |
459 | self.manifest.topdir, abort_if_user_denies=True) | 459 | self.manifest.topdir, |
460 | self.manifest.manifestProject.GetRemote('origin').url, | ||
461 | abort_if_user_denies=True) | ||
460 | pending_proj_names = [project.name for (project, avail) in pending] | 462 | pending_proj_names = [project.name for (project, avail) in pending] |
461 | pending_worktrees = [project.worktree for (project, avail) in pending] | 463 | pending_worktrees = [project.worktree for (project, avail) in pending] |
462 | try: | 464 | try: |