Skip to content

Instantly share code, notes, and snippets.

@geoffreyd
Created April 29, 2011 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoffreyd/948253 to your computer and use it in GitHub Desktop.
Save geoffreyd/948253 to your computer and use it in GitHub Desktop.
exports['git-commits'] = function(doc, req) {
var newDoc = JSON.parse(req.body);
newDoc.type = 'commit';
if (req.uuid) {
newDoc._id = req.uuid;
} else {
newDoc._id = "commit-"+Date.now()+newDoc.repository.url;
}
return [newDoc, '{"status":"ok"}'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment