| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,21 +3,34 @@ NodeGit | |||
| 3 | 3 | ||
| 4 | 4 | > Node bindings to the [libgit2](http://libgit2.github.com/) project. | |
| 5 | 5 | ||
| 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) | ||
| 9 | 12 | ||
| 10 | - ## Have a problem? Come chat with us! ## | ||
| 11 | 13 | ||
| 12 | - [](https://gitter.im/nodegit/nodegit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
| 13 | 14 | ||
| 14 | 15 | **Stable: 0.2.7** | |
| 15 | 16 | ||
| 17 | + **Working: 0.3.0** | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + | ||
| 21 | + ## Have a problem? Come chat with us! ## | ||
| 22 | + | ||
| 23 | + [] | ||
| 24 | + (https://gitter.im/nodegit/nodegit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
| 16 | 25 | ## 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)! | ||
| 18 | 30 | ||
| 19 | 31 | ### 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) | ||
| 21 | 34 | ||
| 22 | 35 | ## API Documentation. ## | |
| 23 | 36 | ||
@@ -40,7 +53,7 @@ Minimum dependencies: | |||
| 40 | 53 | ||
| 41 | 54 | - [Python 2](https://www.python.org/) | |
| 42 | 55 | ||
| 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. | ||
| 44 | 57 | ||
| 45 | 58 | ``` bash | |
| 46 | 59 | # Fetch this project. | |
@@ -49,7 +62,7 @@ git clone git://github.com/nodegit/nodegit.git | |||
| 49 | 62 | # Enter the repository. | |
| 50 | 63 | cd nodegit | |
| 51 | 64 | ||
| 52 | - # Installs the template engine, run the code generation script, and build. | ||
| 65 | + # Install all dependencies, run the code generation scripts, and build. | ||
| 53 | 66 | npm install | |
| 54 | 67 | ``` | |
| 55 | 68 | ||
@@ -63,11 +76,16 @@ can get a backtrace with [gdb](http://www.gnu.org/software/gdb/) or | |||
| 63 | 76 | ||
| 64 | 77 | In order to do so, follow these steps: | |
| 65 | 78 | ||
| 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` | ||
| 71 | 89 | ||
| 72 | 90 | ### Installing dependencies: ### | |
| 73 | 91 | ||
@@ -89,12 +107,15 @@ Using Pacman in Arch Linux: | |||
| 89 | 107 | sudo pacman -S base-devel | |
| 90 | 108 | ``` | |
| 91 | 109 | ||
| 110 | + Note that GCC/G++ 4.7+ are required, as the library makes use of some c++11 std calls. | ||
| 111 | + | ||
| 92 | 112 | #### Windows #### | |
| 93 | 113 | ||
| 94 | 114 | - [Download and install Python](https://www.python.org/download/windows). | |
| 95 | 115 | - [Download and install VS Express](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop). | |
| 96 | 116 | ||
| 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. | ||
| 98 | 119 | ||
| 99 | 120 | *Allegedly the order in which you install Visual Studio could trigger this error.* | |
| 100 | 121 | ||
@@ -103,6 +124,16 @@ npm install nodegit --msvs_version=2013 | |||
| 103 | 124 | # Or whatever version you've installed. | |
| 104 | 125 | ``` | |
| 105 | 126 | ||
| 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 | + | ||
| 106 | 137 | ## API examples. ## | |
| 107 | 138 | ||
| 108 | 139 | ### Cloning a repository and reading a file: ### | |
@@ -191,6 +222,8 @@ open("tmp") | |||
| 191 | 222 | }); | |
| 192 | 223 | ``` | |
| 193 | 224 | ||
| 225 | + For more examples, check the `examples/` folder. | ||
| 226 | + | ||
| 194 | 227 | ## Unit tests. ## | |
| 195 | 228 | ||
| 196 | 229 | 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 | |||
| 206 | 239 | ||
| 207 | 240 | This update is wholly and entirely a breaking one, and older versions won't be | |
| 208 | 241 | 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. | ||
| 210 | 244 | ||
| 211 | 245 | ## nw.js (Node-Webkit) ## | |
| 212 | 246 | ||
| 213 | 247 | ### 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 | ||
| 216 | 250 | 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. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments