Skip to content

Commit cf1a29a

Browse files
committed
Add a few notes to the readme and clean up a bit
1 parent 8e6f03b commit cf1a29a

File tree

1 file changed

+73
-26
lines changed

1 file changed

+73
-26
lines changed

README.md

Lines changed: 73 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,34 @@ NodeGit
33

44
> Node bindings to the [libgit2](http://libgit2.github.com/) project.
55
6-
[![Build Status] (https://travis-ci.org/nodegit/nodegit.svg)](https://travis-ci.org/nodegit/nodegit)
7-
[![Build status] (https://ci.appveyor.com/api/projects/status/e5a5q75l9yfhnfv2?svg=true)](https://ci.appveyor.com/project/timbranyen/nodegit)
8-
[![Dependency Status] (https://david-dm.org/nodegit/nodegit.svg)](https://david-dm.org/nodegit/nodegit)
6+
[![Build Status] (https://travis-ci.org/nodegit/nodegit.svg)]
7+
(https://travis-ci.org/nodegit/nodegit)
8+
[![Build status] (https://ci.appveyor.com/api/projects/status/e5a5q75l9yfhnfv2?svg=true)]
9+
(https://ci.appveyor.com/project/timbranyen/nodegit)
10+
[![Dependency Status] (https://david-dm.org/nodegit/nodegit.svg)]
11+
(https://david-dm.org/nodegit/nodegit)
912

10-
## Have a problem? Come chat with us! ##
1113

12-
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/nodegit/nodegit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1314

1415
**Stable: 0.2.7**
1516

17+
**Working: 0.3.0**
18+
19+
20+
21+
## Have a problem? Come chat with us! ##
22+
23+
[![Gitter](https://badges.gitter.im/Join Chat.svg)]
24+
(https://gitter.im/nodegit/nodegit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1625
## Maintained by ##
17-
Tim Branyen [@tbranyen](http://twitter.com/tbranyen), John Haley [@johnhaley81](http://twitter.com/johnhaley81), and Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp) with help from [awesome contributors](https://github.com/nodegit/nodegit/contributors)!
26+
Tim Branyen [@tbranyen](http://twitter.com/tbranyen),
27+
John Haley [@johnhaley81](http://twitter.com/johnhaley81), and
28+
Max Korp [@maxkorp](http://twitter.com/MaximilianoKorp) with help from tons of
29+
[awesome contributors](https://github.com/nodegit/nodegit/contributors)!
1830

1931
### Alumni Maintainers ###
20-
Michael Robinson [@codeofinterest](http://twitter.com/codeofinterest), and Nick Kallen [@nk](http://twitter.com/nk)
32+
Michael Robinson [@codeofinterest](http://twitter.com/codeofinterest), and
33+
Nick Kallen [@nk](http://twitter.com/nk)
2134

2235
## API Documentation. ##
2336

@@ -40,7 +53,7 @@ Minimum dependencies:
4053

4154
- [Python 2](https://www.python.org/)
4255

43-
If you wish to help contribute to nodegit it is useful to build locally.
56+
If you wish to help contribute to NodeGit it is useful to build locally.
4457

4558
``` bash
4659
# Fetch this project.
@@ -49,7 +62,7 @@ git clone git://github.com/nodegit/nodegit.git
4962
# Enter the repository.
5063
cd nodegit
5164

52-
# Installs the template engine, run the code generation script, and build.
65+
# Install all dependencies, run the code generation scripts, and build.
5366
npm install
5467
```
5568

@@ -63,11 +76,16 @@ can get a backtrace with [gdb](http://www.gnu.org/software/gdb/) or
6376

6477
In order to do so, follow these steps:
6578

66-
1. `BUILD_ONLY=true npm install`, or `BUILD_ONLY=true npm link .` if
67-
you are into it
68-
2. `rm -rf build/Release`
69-
3. `node-gyp configure --debug`
70-
4. `node-gyp build --debug`
79+
1. `BUILD_ONLY=true npm install` (or `BUILD_ONLY=true npm link`)
80+
3. `node-gyp rebuild --debug` (the same as `node-gyp clean configure --debug build`)
81+
82+
If you're doing a subsequent rebuild of NodeGit in debug, the clean function will cause
83+
a lot of extraneous recompilation of things you probably didn't change (like the vendor
84+
dependencies).
85+
86+
1. `BUILD_ONLY=true npm install` (or `BUILD_ONLY=true npm link`)
87+
2. `rm -rf build/Release` to make sure a release build doesnt get loaded instead of the debug build.
88+
3. `node-gyp configure build --debug`
7189

7290
### Installing dependencies: ###
7391

@@ -89,12 +107,15 @@ Using Pacman in Arch Linux:
89107
sudo pacman -S base-devel
90108
```
91109

110+
Note that GCC/G++ 4.7+ are required, as the library makes use of some c++11 std calls.
111+
92112
#### Windows ####
93113

94114
- [Download and install Python](https://www.python.org/download/windows).
95115
- [Download and install VS Express](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop).
96116

97-
You may have to add a build flag to the installation process to successfully install. Try first without, if the build fails, try again with the flag.
117+
You may have to add a build flag to the installation process to successfully install.
118+
Try first without, if the build fails, try again with the flag.
98119

99120
*Allegedly the order in which you install Visual Studio could trigger this error.*
100121

@@ -103,6 +124,16 @@ npm install nodegit --msvs_version=2013
103124
# Or whatever version you've installed.
104125
```
105126

127+
##### A note on environment variables in Windows #####
128+
In many of the npm scripts (and examples above), things are run like
129+
`BUILD_ONLY=true npm install`. This sets the `BUILD_ONLY` environment variable
130+
to true for the duration of that command. This doesn't work in windows, however
131+
there is a solution. You can use cmd to call a command inside of cmd (very meta)
132+
with the variable set, and it only lasts for the duration of the inner call to cmd.
133+
So for the above example, you would run `cmd /C "set BUILD_ONLY=true && npm install"`.
134+
See here for more details:
135+
[SuperUser](http://superuser.com/questions/223104/setting-environment-variable-for-just-one-command-in-windows-cmd-exe).
136+
106137
## API examples. ##
107138

108139
### Cloning a repository and reading a file: ###
@@ -191,6 +222,8 @@ open("tmp")
191222
});
192223
```
193224

225+
For more examples, check the `examples/` folder.
226+
194227
## Unit tests. ##
195228

196229
You will need to build locally before running the tests. See above.
@@ -206,19 +239,33 @@ https://github.com/nodegit/nodegit/compare/refs/tags/0.1.4...0.2.0
206239

207240
This update is wholly and entirely a breaking one, and older versions won't be
208241
maintained. For the purpose of migration, perhaps the biggest point to make
209-
is that async methods can now use promises, rather than just taking callbacks. Additionally, lots of method and property names have changed.
242+
is that async methods can now use promises, rather than just taking callbacks.
243+
Additionally, lots of method and property names have changed.
210244

211245
## nw.js (Node-Webkit) ##
212246

213247
### Native compilation for nw.js ###
214-
A common issue is with nodegit not functioning properly inside of
215-
[nw.js](http://github.com/nwjs/nw.js) applications. Because nodegit
248+
A common issue is with NodeGit not functioning properly inside of
249+
[nw.js](http://github.com/nwjs/nw.js) applications. Because NodeGit
216250
is a native module, it has to be rebuilt for node-webkit using
217-
[nw-gyp](http://github.com/rogerwang/nw-gyp). By default, nodegit will look in the root package's package.json for an `engines` property, and within look for a `nw.js` property (or a `node-webkit` if the prior isn't found) that holds a specific version of nw.js. The value of this property is what will get passed as the `--target` argument to `nw-gyp configure`.
218-
219-
### Version incompatibiltiy ###
220-
Prior to version 0.2.6, nodegit used [nan](http://github.com/rvagg/nan) v1.4.3. As of 0.2.6, nodegit uses nan v1.5.1 to provide support for io.js. Unfortunately, this breaks some nw.js compatability. With nw.js 0.12+, the name was changed to nw.js from node-webkit. The alpha currently still breaks with nodegit due to the nan update, but should be fixed in the final v0.12.0 release. Åpplications using previous versions of node webkit have 2 options:
221-
1) Use an older version (v0.2.4 or earlier) of nodegit
222-
2) Use [npm shrinkwrap](https://docs.npmjs.com/cli/shrinkwrap) to force nodegit to use nan v1.4.3. Since the binary always recompiles when being used with nw.js, you shouldnt have to do anything else to make sure it works. As of nodegit v0.2.6, the change to nan v1.4.3 doesn't cause any problems.
223-
224-
Currently, support for nw.js is limited, although we intend to support it better in the future.
251+
[nw-gyp](http://github.com/rogerwang/nw-gyp). By default, NodeGit will look
252+
in the root package's package.json for an `engines` property, and within look
253+
for a `nw.js` property (or a `node-webkit` if the prior isn't found) that holds
254+
a specific version of nw.js. The value of this property is what will get passed
255+
as the `--target` argument to `nw-gyp configure`.
256+
257+
### Version incompatibility ###
258+
Prior to version 0.2.6, NodeGit used [nan](http://github.com/rvagg/nan) v1.4.3.
259+
As of 0.2.6, NodeGit uses nan v1.5.1 to provide support for io.js. Unfortunately,
260+
this breaks some nw.js compatibility. With nw.js 0.12+, the name was changed to
261+
nw.js from node-webkit. The alpha currently still breaks with NodeGit due to the
262+
nan update, but should be fixed in the final v0.12.0 release. Åpplications using
263+
previous versions of node webkit have 2 options:
264+
1) Use an older version (v0.2.4 or earlier) of NodeGit
265+
2) Use [npm shrinkwrap](https://docs.npmjs.com/cli/shrinkwrap) to force NodeGit to
266+
use nan v1.4.3. Since the binary always recompiles when being used with nw.js, you
267+
shouldn't have to do anything else to make sure it works. As of NodeGit v0.2.6,
268+
the change to nan v1.4.3 doesn't cause any problems.
269+
270+
Currently, support for nw.js is limited, although we intend to support it better
271+
in the future.

0 commit comments

Comments
 (0)