Skip to content

Instantly share code, notes, and snippets.

@bdotdub
Created October 11, 2010 07:07
Show Gist options
  • Save bdotdub/620156 to your computer and use it in GitHub Desktop.
Save bdotdub/620156 to your computer and use it in GitHub Desktop.
//
// BlobAppDelegate.m
// Blob
//
// Created by Benny Wong on 10/10/10.
// Copyright 2010 Seedless Media. All rights reserved.
//
#import "BlobAppDelegate.h"
#import "git/odb.h"
#import "git/commit.h"
#import "git/revwalk.h"
#import "commit.h"
@implementation BlobAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Just to see how libgit2 works
git_odb *odb;
git_odb_open(&odb, "/Users/bwong/Development/ruby/ribbit/.git/objects");
git_revpool *pool;
pool = gitrp_alloc(odb);
git_oid id;
git_oid_mkstr(&id, "bda6513a85f96aae0544a8541f4b3cd56419abe1");
git_commit *head;
head = git_commit_parse(pool, &id);
gitrp_push(pool, head);
git_commit *commit = NULL;
int i = 0;
while ((commit = gitrp_next(pool)) != NULL) {
NSLog(@"%d :: %@", i, commit->committer->name);
++i;
}
git_odb_close(odb);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment