--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+change-abandoned hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit change-abandoned hook")
+ args = (
+ "--change", # <change id>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--topic", # <topic>
+ "--abandoner", # <abandoner>
+ "--reason" # <reason>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ change-abandoned hook entry """
+
+ return run_plugin_hooks("change-abandoned", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+change-merged hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit change-merged hook")
+ args = (
+ "--change", # <change id>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--topic", # <topic>
+ "--submitter", # <submitter>
+ "--commit", # <sha1>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ change-merged hook entry """
+
+ return run_plugin_hooks("change-merged", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+change-restored hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit change-restored hook")
+ args = (
+ "--change", # <change id>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--topic", # <topic>
+ "--restorer", # <restorer>
+ "--reason", # <reason>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ change-restored hook entry """
+
+ return run_plugin_hooks("change-restored", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+cla-signed hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit cla-signed hook")
+ args = (
+ "--submitter", # <submitter>
+ "--user-id", # <user_id>
+ "--cla-id", # <cla_id>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ cla-signed hook entry """
+
+ return run_plugin_hooks("cla-signed", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+comment-added hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit comment-added hook")
+ args = (
+ "--change", # <change id>
+ "--is-draft", # <boolean>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--topic", # <topic>
+ "--author", # <comment author>
+ "--commit", # <commit>
+ "--comment", # <comment>
+ # TODO: [--<approval category id> <score> ...]
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_known_args(argv)
+
+
+def main():
+ """ comment-added hook entry """
+
+ return run_plugin_hooks("comment-added", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+draft-published hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit draft-published hook")
+ args = (
+ "--change", # <change id>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--topic", # <topic>
+ "--uploader", # <uploader>
+ "--commit", # <sha1>
+ "--patchset", # <patchset id>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ draft-published hook entry """
+
+ return run_plugin_hooks("draft-published", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+merge-failed hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit merge-failed hook")
+ args = (
+ "--change", # <change id>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--topic", # <topic>
+ "--submitter", # <submitter>
+ "--commit", # <sha1>
+ "--reason", # <reason>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ merge-failed hook entry """
+
+ return run_plugin_hooks("merge-failed", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+ref-update hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit ref-update hook")
+ args = (
+ "--project", # <project name>
+ "--refname", # <refname>
+ "--uploader", # <uploader>
+ "--oldrev", # <sha1>
+ "--newrev" # <sha1>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ ref-update hook entry """
+
+ return run_plugin_hooks("ref-update", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+red-updated hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit red-updated hook")
+ args = (
+ "--oldrev", # <old rev>
+ "--newrev", # <new rev>
+ "--refname", # <ref name>
+ "--project", # <project name>
+ "--submitter", # <submitter>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ red-updated hook entry """
+
+ return run_plugin_hooks("red-updated", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())
--- /dev/null
+#!/usr/bin/env
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+#
+# Copyright (c) 2013 Intel, Inc.
+# License: GPLv2
+# Author: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+
+"""
+reviewer-added hook entry module
+"""
+
+import sys
+import argparse
+
+from gerrithooks.common import run_plugin_hooks
+
+def parse_cmdline(argv):
+ """Parse hook command line parameters."""
+ parser = argparse.ArgumentParser(
+ description="Gerrit reviewer-added hook")
+ args = (
+ "--change", # <change id>
+ "--change-url", # <change url>
+ "--project", # <project name>
+ "--branch", # <branch>
+ "--reviewer", # <reviewer>
+ )
+ for arg in args:
+ parser.add_argument(arg)
+ parser.add_argument("-d", "--debug", action="store_true")
+ return parser.parse_args(argv)
+
+
+def main():
+ """ reviewer-added hook entry """
+
+ return run_plugin_hooks("reviewer-added", parse_cmdline)
+
+if __name__ == "__main__":
+ sys.exit(main())