From 65e0f35fda0559e79316c8fdbeeaed6dd51e9a4d Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Mon, 18 Apr 2011 11:23:29 +0200 Subject: [PATCH] Add commit-msg hook also for manifest project The manifest project has - by design - not a review URL associated with it. It is actually not even a 'project' in repo's sense. This will prevent the commit-msg hook from being added, which is not necessarily wanted as the project is managed in gerrit. This commit will enable the commit-msg hook, which in turn will add the Change-Id-line to every new commit in it. This simplifies replacing patch sets (by git push ... refs/for/...). Change-Id: I42d0f6fd79e6282d9d47074a3819e68d968999a7 Signed-off-by: Victor Boivie --- project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project.py b/project.py index 9d67dead..3efc4452 100644 --- a/project.py +++ b/project.py @@ -1484,10 +1484,13 @@ class Project(object): for stock_hook in _ProjectHooks(): name = os.path.basename(stock_hook) - if name in ('commit-msg',) and not self.remote.review: + if name in ('commit-msg',) and not self.remote.review \ + and not self is self.manifest.manifestProject: # Don't install a Gerrit Code Review hook if this # project does not appear to use it for reviews. # + # Since the manifest project is one of those, but also + # managed through gerrit, it's excluded continue dst = os.path.join(hooks, name)