Does Gitorious have hooks for CIA commit notification?

3.3k Views Asked by At

As I am running out of my space on GitHub on my free account (yes, I am considering upgrading), I am setting up new git repositories on Gitorious (see also GitHub vs Gitorious). One great feature of GitHub is the post-commit hooks, that allow me to notify the (also great) CIA network...

However, I have been unable to find if Gitorious supports such hooks... So, I'd like to ask best practices for getting commit messages show up on the CIA network for Gitorious-hosted git repositories.

Update: the solution of using a secondary mechanism to trigger CIA commit messages is not what I am looking for.

5

There are 5 best solutions below

2
On BEST ANSWER

Instead of pushing straight to Gitorious, push to a local repository that you've configured (in its post-receive hook) to both push everything to your Gitorious repository and notify CIA.

2
On

My current workaround is to set up a loal repository (called CIA) and always push via a tiny shell script:

#!/bin/bash
set -e
git push origin master
git push cia master

In the local CIA repository I installed http://cia.vc/clients/git/ciabot.bash to send emails to the CIA.

3
On

Gitorious is getting web hook support. It is currently running on gitorious.org, but without a UI for adding them to your repository; the reason for this is that there still may be a change or two to the JSON representation of the commit data exposed, so it should be configured a beta feature.

Anyone feeling up to writing integration code (handling gitorious' web hook requests), please send an email to support at gitorious.org and we'll set up the integration for your repository

2
On

The KDE project had a similar question in that thread, with an interesting alternative:

It doesn't have to be running on gitorious.org machines. At least, not for email/CIA/RSS/whatever reporting

That's how our old git-p4 hook worked in the office:
the p4 machine sent out a UDP packet with the revision number. Another machine caught it and did the import. (the value was discarded)

We could do the same:

  • the gitorious.org machine sends a UDP packet with the branches that changed and their new SHA-1.
  • Another machine fetches and produces the commit logs.
    Worst case scenario is that someone is forgotten due to a dropped UDP packet.

Like I said, this works for reporting -- for anything that is run by a post-receive hook.
For anything requiring a pre-receive hook (actually, pre-update, but the name is wrong in Git), it will have to be run on their servers.

0
On

Gitorious supports "Web Hooks": http://gitorious.org/gitorious/pages/WebHooks

It's a bit more effort, as it requires you to have a web server set up to receive the hook API calls.