wiki:GitRepositoryDetails

Version 5 (modified by jdreed, 11 years ago) (diff)

--

Technical Information about the Git Repository

Hosting

The canonical repository is on drugstore.mit.edu (a/k/a git.mit.edu), accessibly via git+ssh://. Each package has its own repository in the path /git/athena.

Members of athena-commiters [sic] have smrsh shells which allow access to both git and svn.

Other Accounts

  • athenasnap: Used by debathena-root for things requiring shell access, such as fixing hooks, etc.
  • debuildsvn: Deprecated in favor of builder account.
  • builder: Used by the build server to svn up/git pull checkouts. Do not use this for committing or you will get punched in the face.

Hooks

Currently, each repository has its hooks directory renamed to hooks.orig and a hooks symlink pointing at /git/athena/krbdev-services/githooks. This is a fork of the krbdev-services repository from the krb5 team, as we stole most of their hooks, and workflow.

Hooks directory

The contents of the directory, and what they are for:

  • authors: Maps usernames to real people. Used by update hook.
  • hookutils.py: Used by various hooks
  • krb5-rt-id: Currently unused.
  • post-receive: The master post-receive hook. It runs the notify, push, and rt hooks in turn.
  • post-receive-notify: Sends mail upon a new commit. (And possibly zephyrs?)
  • post-receive-push: Pushes to a mirror (in this case, github)
  • post-receive-rt: Does operations in RT as appropriate (currently unused)
  • ssh-as-krbsnap: Unused.
  • update: The master update hook. Prevents fast-forwards, enforces style guidelines, etc.

Hook configuration

Much of the hooks are configured by git configuration in the repository. Values we care about:

  • receive.denynonfastforwards=true
  • hooks.push-to=github
  • hooks.mailinglist=source-commits@mit.edu
  • hooks.verbose=true
  • hooks.reponame= (repository name)
  • hooks.commit-url-prefix=https://github.com/mit-athena/(repository name)/commit/
    • TODO: Why doesn't this use hooks.reponame?

/git/athena/private

This includes things used by hooks, etc:

  • github_id_rsa, github_id_rsa.pub: Keypairs for mit-athena project on Github.
  • github-password: username/password for the github account
  • known_hosts: An SSH known hosts file for Github, but they move IPs too much (not currently in use)
  • my-ssh: The ssh command to push to Github. If you run this interactively, ssh will yell at you about permissions on the keypair. We should also rename this command.

Setting Up A New Repository For A New Package

TODO: achernya should sanity check this. Do we need to create the github repo separately?

git init --bare --shared=group /git/athena/packagename.git
cd /git/athena/packagename.git
mv hooks hooks.orig
ln -s /git/athena/krbdev-services/githooks hooks
git config core.sharedRepository group         #Should be set by shared=group
git config core.logAllRefUpdates true
git remote add --mirror=push github git@github.com:mit-athena/packagename.git
git config gc.reflogexpire never
git config gc.reflogexpireunreachable never
git config receive.fsckObjects true
git config receive.denyNonFastForwards true     #Should be set by shared=group
git config hooks.push-to github
git config hooks.mailinglist source-commits@mit.edu
git config hooks.verbose true
git config hooks.reponame packagename
git config hooks.commit-url-prefix https://github.com/mit-athena/packagename/commit/