Hosting SoC Repo On Github

From MultimediaWiki
Jump to navigation Jump to search

If you prefer hosting your SoC code on a git repo at Github or elsewhere instead of the ffmpeg-soc svn repo, you have to make sure that the ffmpeg-soc mailing list is notified of your commits. Github does provide an email service hook for this, but the commit diff is not included in the email payload.This can be overcome by setting up a local repo and configuring the git post-receive hook to notify the mailing list, and pushing to both the local repo as well as github. The following steps detail the procedure. It is assumed that you already have git installed.

  1. Clone the ffmpeg git repo (http://ffmpeg.org/download.html) and execute the following commands.
    git clone --bare ffmpeg ffmpeg-soc #creates a directory named ffmpeg-soc.git
    cd ffmpeg
    git remote add local /path/to/cloned/repo #eg: git remote add local /home/user/ffmpeg-soc.git
  2. Set up commit notification emails.
    cd ffmpeg-soc.git
    git config --add hooks.mailinglist "ffmpeg-soc@mplayer.hq"
    git config hooks.emailprefix "[soc]"
    git config hooks.showrev "git show -C %s;echo" #ensure diff is included in the mail
    cp /path/to/post-receive-email hooks/post-receive #post-receive-email can usually be found in /usr/share/doc/git-core/contrib/hooks
    chmod +x hooks/post-receive
  3. Edit ffmpeg-soc.git/hooks/post-receive to your liking (determines the email payload). Add a short description of your project to ffmpeg-soc.git/description (this will be used in the email subject)
  4. Set up sendmail if you haven't already. To use gmail as a sendmail relay, refer http://james-lloyd.com/getting-sendmail-use-gmail-as-a-relay-2.
  5. Create a github account if you haven't already, create a new repo and populate it.
    cd ffmpeg
    git remote add soc git@github.com:{user_name}/{repo_name}.git
    git push soc master
  6. After committing your code in the local ffmpeg repo, use a script like the one below to push it upstream.
    !/bin/bash
    git push soc master #push to github
    git push local master #push to the local repo

And you are done!