1313 < body >
1414 <!-- Fork Me -->
1515 < a href ="http://github.com/tbranyen/nodegit ">
16- < img class ="forkme " src ="http://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png " alt ="Fork me on GitHub ">
16+ < img class ="forkme "
17+ src ="http://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png "
18+ alt ="Fork me on GitHub ">
1719 </ a >
1820
1921 < div id ="container ">
3335 </ section >
3436
3537 < div class ="description ">
36- < span class ="version "> Version 0.0.4</ span > Node.js libgit2 asynchronous native bindings
38+ < span class ="version "> Version 0.0.6</ span > Node.js libgit2 asynchronous
39+ native bindings
3740 </ div >
3841
39- < p > A collection of non-blocking Node.js libgit2 bindings, raw api, convenience api, unit tests, documentation and accomodations to make contributing easier.</ p >
42+ < p > A collection of non-blocking Node.js libgit2 bindings, raw api,
43+ convenience api, unit tests, documentation and accomodations to make
44+ contributing easier.</ p >
4045
4146 < h2 > require</ h2 >
4247 < p >
4348 < ul >
44- < li > < a href ="http://nodejs.org/ " target ="_blank "> Node.js 0.4.2 or latest </ a > </ li >
49+ < li > < a href ="http://nodejs.org/ " target ="_blank "> Node.js ~0.8 </ a > </ li >
4550 < li > < a href ="http://npmjs.org/ " target ="_blank "> NPM</ a > < em > ( if you want the premiere install experience )</ em > </ li >
4651 < li > < a href ="http://git-scm.com/ " target ="_blank "> Git</ a > < em > ( if you want to unit test )</ em > </ li >
4752 </ ul >
@@ -55,63 +60,58 @@ <h2>install</h2>
5560 < h2 > use</ h2 >
5661 < p > < em > emulate `git log`</ em > </ p >
5762 < pre > < code >
58- // Load in the module
59- var git = require( 'nodegit' );
60- // Open a repository for reading
61- git.repo( '.git', function( err, repo ) {
62- // Success is always 0, failure is always an error string
63- if( err ) {
64- throw new Error( err );
63+ // Load in the module.
64+ var git = require("nodegit");
65+
66+ // Open the repository in the current directory.
67+ git.repo(".git", function(err, repo) {
68+ if (err) {
69+ throw err;
70+ }
71+
72+ // Use the master branch.
73+ repo.branch("master", function(err, branch) {
74+ if (err) {
75+ throw err;
6576 }
66-
67- // Use the master branch
68- repo.branch( 'master', function( err, branch ) {
69- if( err ) {
70- throw new Error( err );
71- }
72-
73- // Iterate over the revision history
74- var history = branch.history();
75- history.on( 'commit', function( index, commit ) {
76- // Print out `git log` emulation
77- console.log( 'commit ' + commit.sha );
78- console.log( '\n' );
79- console.log( commit.author.name + '< ' + commit.author.email + '> ' );
80- console.log( commit.time );
81- console.log( commit.message );
82- });
83-
84- history.on( 'end', function() {
85- // Continue
86- });
77+
78+ // Iterate over the revision history.
79+ branch.history().on("commit", function( index, commit ) {
80+ // Print out `git log` emulation.
81+ console.log("commit " + commit.sha);
82+ console.log("\n");
83+ console.log(commit.author.name + "< " + commit.author.email + "> ");
84+ console.log(commit.time);
85+ console.log(commit.message);
8786 });
87+ });
8888 });
8989 </ code >
9090 </ pre >
9191
9292 < p > < em > view commit tree and blob information</ em > </ p >
9393 < pre > < code >
94- // Load in the module
95- var git = require( 'nodegit' );
96- // Open a repository for reading
97- git.repo( '.git', function( err, repo ) {
98- // Success is always 0, failure is always an error string
99- if( err ) {
100- throw new Error( err );
94+ // Load in the module.
95+ var git = require("nodegit");
96+
97+ // Open the repository in the current directory.
98+ git.repo(".git", function(err, repo) {
99+ if (err) {
100+ throw err;
101+ }
102+
103+ // Use the master branch.
104+ repo.branch("master", function(err, branch) {
105+ if (err) {
106+ throw err;
101107 }
102108
103- // Use the master branch
104- repo.branch( 'master', function( err, branch ) {
105- if( err ) {
106- throw new Error( err );
107- }
108-
109- // Iterate over the revision history
110- branch.tree().walk(function( i, entry ) {
111- console.log( entry.name );
112- console.log( entry.content );
113- });
109+ // Iterate over the revision history.
110+ branch.tree().walk(function(i, entry) {
111+ console.log(entry.name);
112+ console.log(entry.content);
114113 });
114+ });
115115 });
116116 </ code >
117117 </ pre >
0 commit comments