Git Product home page Git Product logo

node-gitteh's Introduction

libgit2 - the Git linkable library

Build Status
main branch CI builds CI Build
v1.8 branch CI builds CI Build
v1.7 branch CI builds CI Build
Nightly builds Nightly Build Coverity Scan Status

libgit2 is a portable, pure C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Language bindings like Rugged (Ruby), LibGit2Sharp (.NET), pygit2 (Python) and NodeGit (Node) allow you to build Git tooling in your favorite language.

libgit2 is used to power Git GUI clients like GitKraken and GitButler and on Git hosting providers like GitHub, GitLab and Azure DevOps. We perform the merge every time you click "merge pull request".

libgit2 is licensed under a very permissive license (GPLv2 with a special Linking Exception). This means that you can link against the library with any kind of software without making that software fall under the GPL. Changes to libgit2 would still be covered under its GPL license. Additionally, the example code has been released to the public domain (see the separate license for more information).

Table of Contents

Using libgit2

Most of these instructions assume that you're writing an application in C and want to use libgit2 directly. If you're not using C, and you're writing in a different language or platform like .NET, Node.js, or Ruby, then there is probably a "language binding" that you can use to take care of the messy tasks of calling into native code.

But if you do want to use libgit2 directly - because you're building an application in C - then you may be able use an existing binary. There are packages for the vcpkg and conan package managers. And libgit2 is available in Homebrew and most Linux distributions.

However, these versions may be outdated and we recommend using the latest version if possible. Thankfully libgit2 is not hard to compile.

Quick Start

Prerequisites for building libgit2:

  1. CMake, and is recommended to be installed into your PATH.
  2. Python is used by our test framework, and should be installed into your PATH.
  3. C compiler: libgit2 is C90 and should compile on most compilers.
    • Windows: Visual Studio is recommended
    • Mac: Xcode is recommended
    • Unix: gcc or clang is recommended.

Build

  1. Create a build directory beneath the libgit2 source directory, and change into it: mkdir build && cd build
  2. Create the cmake build environment: cmake ..
  3. Build libgit2: cmake --build .

Trouble with these steps? Read our troubleshooting guide. More detailed build guidance is available below.

Getting Help

Chat with us

Getting Help

If you have questions about the library, please be sure to check out the API documentation. If you still have questions, reach out to us on Slack or post a question on StackOverflow (with the libgit2 tag).

Reporting Bugs

Please open a GitHub Issue and include as much information as possible. If possible, provide sample code that illustrates the problem you're seeing. If you're seeing a bug only on a specific repository, please provide a link to it if possible.

We ask that you not open a GitHub Issue for help, only for bug reports.

Reporting Security Issues

Please have a look at SECURITY.md.

What It Can Do

libgit2 provides you with the ability to manage Git repositories in the programming language of your choice. It's used in production to power many applications including GitHub.com, Plastic SCM and Azure DevOps.

It does not aim to replace the git tool or its user-facing commands. Some APIs resemble the plumbing commands as those align closely with the concepts of the Git system, but most commands a user would type are out of scope for this library to implement directly.

The library provides:

  • SHA conversions, formatting and shortening
  • abstracted ODB backend system
  • commit, tag, tree and blob parsing, editing, and write-back
  • tree traversal
  • revision walking
  • index file (staging area) manipulation
  • reference management (including packed references)
  • config file management
  • high level repository management
  • thread safety and reentrancy
  • descriptive and detailed error messages
  • ...and more (over 175 different API calls)

As libgit2 is purely a consumer of the Git system, we have to adjust to changes made upstream. This has two major consequences:

  • Some changes may require us to change provided interfaces. While we try to implement functions in a generic way so that no future changes are required, we cannot promise a completely stable API.
  • As we have to keep up with changes in behavior made upstream, we may lag behind in some areas. We usually to document these incompatibilities in our issue tracker with the label "git change".

Optional dependencies

While the library provides git functionality without the need for dependencies, it can make use of a few libraries to add to it:

  • pthreads (non-Windows) to enable threadsafe access as well as multi-threaded pack generation
  • OpenSSL (non-Windows) to talk over HTTPS and provide the SHA-1 functions
  • LibSSH2 to enable the SSH transport
  • iconv (OSX) to handle the HFS+ path encoding peculiarities

Initialization

The library needs to keep track of some global state. Call

git_libgit2_init();

before calling any other libgit2 functions. You can call this function many times. A matching number of calls to

git_libgit2_shutdown();

will free the resources. Note that if you have worker threads, you should call git_libgit2_shutdown after those threads have exited. If you require assistance coordinating this, simply have the worker threads call git_libgit2_init at startup and git_libgit2_shutdown at shutdown.

Threading

See threading for information

Conventions

See conventions for an overview of the external and internal API/coding conventions we use.

Building libgit2 - Using CMake

Building

libgit2 builds cleanly on most platforms without any external dependencies. Under Unix-like systems, like Linux, *BSD and Mac OS X, libgit2 expects pthreads to be available; they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API for threading.

The libgit2 library is built using CMake (version 2.8 or newer) on all platforms.

On most systems you can build the library using the following commands

$ mkdir build && cd build
$ cmake ..
$ cmake --build .

Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.

If you're not familiar with CMake, a more detailed explanation may be helpful.

Running Tests

Once built, you can run the tests from the build directory with the command

$ ctest -V

Alternatively you can run the test suite directly using,

$ ./libgit2_tests

Invoking the test suite directly is useful because it allows you to execute individual tests, or groups of tests using the -s flag. For example, to run the index tests:

$ ./libgit2_tests -sindex

To run a single test named index::racy::diff, which corresponds to the test function test_index_racy__diff:

$ ./libgit2_tests -sindex::racy::diff

The test suite will print a . for every passing test, and an F for any failing test. An S indicates that a test was skipped because it is not applicable to your platform or is particularly expensive.

Note: There should be no failing tests when you build an unmodified source tree from a release, or from the main branch. Please contact us or open an issue if you see test failures.

Installation

To install the library you can specify the install prefix by setting:

$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
$ cmake --build . --target install

Advanced Usage

For more advanced use or questions about CMake please read https://cmake.org/Wiki/CMake_FAQ.

The following CMake variables are declared:

  • CMAKE_INSTALL_BINDIR: Where to install binaries to.
  • CMAKE_INSTALL_LIBDIR: Where to install libraries to.
  • CMAKE_INSTALL_INCLUDEDIR: Where to install headers to.
  • BUILD_SHARED_LIBS: Build libgit2 as a Shared Library (defaults to ON)
  • BUILD_TESTS: Build the unit and integration test suites (defaults to ON)
  • USE_THREADS: Build libgit2 with threading support (defaults to ON)

To list all build options and their current value, you can do the following:

# Create and set up a build directory
$ mkdir build
$ cmake ..
# List all build options and their values
$ cmake -L

Compiler and linker options

CMake lets you specify a few variables to control the behavior of the compiler and linker. These flags are rarely used but can be useful for 64-bit to 32-bit cross-compilation.

  • CMAKE_C_FLAGS: Set your own compiler flags
  • CMAKE_FIND_ROOT_PATH: Override the search path for libraries
  • ZLIB_LIBRARY, OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY: Tell CMake where to find those specific libraries
  • LINK_WITH_STATIC_LIBRARIES: Link only with static versions of system libraries

MacOS X

If you want to build a universal binary for Mac OS X, CMake sets it all up for you if you use -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" when configuring.

Android

Extract toolchain from NDK using, make-standalone-toolchain.sh script. Optionally, crosscompile and install OpenSSL inside of it. Then create CMake toolchain file that configures paths to your crosscompiler (substitute {PATH} with full path to the toolchain):

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION Android)

SET(CMAKE_C_COMPILER   {PATH}/bin/arm-linux-androideabi-gcc)
SET(CMAKE_CXX_COMPILER {PATH}/bin/arm-linux-androideabi-g++)
SET(CMAKE_FIND_ROOT_PATH {PATH}/sysroot/)

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Add -DCMAKE_TOOLCHAIN_FILE={pathToToolchainFile} to cmake command when configuring.

MinGW

If you want to build the library in MinGW environment with SSH support enabled, you may need to pass -DCMAKE_LIBRARY_PATH="${MINGW_PREFIX}/${MINGW_CHOST}/lib/" flag to CMake when configuring. This is because CMake cannot find the Win32 libraries in MinGW folders by default and you might see an error message stating that CMake could not resolve ws2_32 library during configuration.

Another option would be to install msys2-w32api-runtime package before configuring. This package installs the Win32 libraries into /usr/lib folder which is by default recognized as the library path by CMake. Please note though that this package is meant for MSYS subsystem which is different from MinGW.

Language Bindings

Here are the bindings to libgit2 that are currently available:

If you start another language binding to libgit2, please let us know so we can add it to the list.

How Can I Contribute?

We welcome new contributors! We have a number of issues marked as "up for grabs" and "easy fix" that are good places to jump in and get started. There's much more detailed information in our list of outstanding projects.

Please be sure to check the contribution guidelines to understand our workflow, and the libgit2 coding conventions.

License

libgit2 is under GPL2 with linking exception. This means you can link to and use the library from any program, proprietary or open source; paid or gratis. However, if you modify libgit2 itself, you must distribute the source to your modified version of libgit2.

See the COPYING file for the full license text.

node-gitteh's People

Contributors

andreypopp avatar ben avatar blmarket avatar deepak1556 avatar deoxxa avatar discord5000 avatar iamwilhelm avatar mcramm avatar mildsunrise avatar peterdavehello avatar trentm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-gitteh's Issues

Error not thrown as expected in `Tree#getEntry()`.

You can see in the REPL output below, a proper Error object isn't being created with the getEntry() call. Let me know if you need any more info!

> repo = require('gitteh').openRepository('.git')
> commit = repo.getCommit('6a355a4cd8f47bfc2d7c5ee951705b8baad5c711')
> commit.getTree().getEntry('doesNotExist')
null      // Expected an Error to be thrown here, not null returned...
> commit.getTree().getEntry('doesNotExist', console.log)
> { stack: [Getter/Setter], arguments: undefined, type: undefined, message: 'Couldn\'t get tree entry.' }    // no stack, no error codes, arguments and type are undefined...

Build with v0.6.14 fails on OS X

Hopefully this gist is visible:

https://gist.github.com/3174abcbd631c4999c0f

> cpp --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Gitteh needs a primary maintainer!

I had an epiphany this week: I've been selfish when it comes to Gitteh.

I've acknowledged several times in issues / emails that I don't really have enough time for Gitteh. But then, like most developers, I'm presented with a problem of some kind and want to solve it. Then suddenly Gitteh seems interesting again, and I feel all inspired and start making some promises to do things that I generally don't.

Today, I think node-gitteh holds the most promise out of most git libraries for Node. Here's why:

  • It's under the official libgit2 umbrella and has compatible licencing.
  • The latest version is stable and has a decent suite of tests.
  • It has a decent amount of interest (260 stars, 37 forks, 10 watchers).
  • It's had a lot of blood, sweat, and tears poured into it :)

I think the design choices made for gitteh are sound, there's been some quibbling regarding some implementation choices (such as CS), but I think these can be addressed in the short-term easily enough.

SO. What I need is for someone to step up to the plate. I need someone who wants to become the primary maintainer for gitteh.

Please mention your interest here, and we'll hash it out. The person I pick to be the primary maintainer will ideally be someone who's shown a healthy amount of interest in gitteh over the past few months and has some Github projects demonstrating an understanding of Node, and C++ (read: best candidate would be someone who's written a Node native module before). Once I find the right person, I will ensure they are given contributor access to this repository.

Unusable on OSX

Error: Cannot find module '../build/default/gitteh'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/Users/alexandruvladutu/www/libgit2/node_modules/gitteh/lib/gitteh.js:1:80)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)

node -v && npm -v
v0.8.11
1.1.62

Gitteh future

Hi,

There are no commits for about 4 months.
So this lib is no more maintained? I'm in doubt to use it or not in a new project.

Thanks.

Cannot read property 'bytes' of undefined

So I'm following the clone example, and every time I get the same error about a property being undefined.

Code

var gitteh = require('gitteh');

var clone = gitteh.clone('http://github.com/libgit2/node-gitteh.git', '/tmp/test');

clone.on('complete', function () {
  // do some stuff
});

clone.on('error', function (err) {
  // do some stuff
});

Stack trace

TypeError: Cannot read property 'bytes' of undefined
    at update [as _onTimeout] (/home/larz/Desktop/test/node_modules/gitteh/lib/gitteh.js:499:51)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

It looks like it's being caused here

File size or timestamp of blob?

Yesterday, when I was walking my repo with gitteh, and listing out the directories, I noticed that neither the entries nor the blobs contained the file size of the blob nor the timestamp of the blob. I don't remember if it was in the pre-0.17 versions of gitteh.

My question is: is the ommision a matter of "we haven't gotten around to it yet", or "it's hard because of reasons X, Y, and Z?

Update documentation

Documentation needs to be generated for new v0.17 refactor. Documentation comments have been written in new gitteh.coffee bridge, we just need to generate some nice looking documentation from them.

Nodenv error

I'm running OSX with a boxen/homebrew nodenv, and I'm getting this error:

$ npm test
nodenv: version `0.10.5' is not installed

I have several node versions installed, including 0.10.5. Applying this patch makes node commands work again:

diff --git a/.node-version b/.node-version
index 9028ec6..adc2d17 100644
--- a/.node-version
+++ b/.node-version
@@ -1 +1 @@
-0.10.5
+v0.10.5

Does anybody else have this problem?

The commit walker doesn't exist anymore

The repo commit walker doesn't exist anymore, and I had relied on it. Was this done because it was decided it doesn't belong in gitteh, or that simply we haven't gotten around to it after the refactor?

If it's the latter (that it simply hasn't been incorporated yet since the refactor), how tough is it to do? I was thinking I'd try my hand at it, if it didn't require knowing too much about native bindings (aka I could use the existing plumbing methods to write it).

Is there a particular signature the walker should support?

I'd like to collaborate

Let me know if I'm doing anything that's already in progress!
I'll be updating this when I complete tasks.
Fix the following tasks in TODO:

  • Provide a GitObject class which the other object types (Commit, Tree, Blob, etc.) will subclass.
  • Work on memory and caching (same pointer, same JS object)
  • Let objects keep a reference to their owning repo, to avoid segfaults.
  • Make sure all create/get stuff in repo is returning local copies of handles.
  • Improve spelling, grammar and some confusing explanations at the docs.

As well as add support for the following features:

  • A generic Repository.get(...) method that returns the object wrapped with the appropiate type.
    We're on a dynamically-typed language!

  • Support for peeling objects.

  • Support for revparse (see #8)

  • Support for ODB managing and streaming (see #4)

  • High-level interface to branches: a Branch type which subclasses Reference. Add the following methods:

    Repository.createBranch
    Repository.getBranch
    Repository.listBranches
    
    Branch.branchName
    Branch.move (in contrast to Reference.rename)
    Branch.getTracking
    
    BRANCH_LOCAL
    BRANCH_REMOTE
    
    Reference.hasLog
    Reference.isLocalBranch
    Reference.isPacked
    Reference == Reference (comparison)
    

And some other utilities:

  • Support for getting libgit2 version as well as node-gitteh version.

  • Determining the merge base of two or more commits.

  • Convenience methods for working with the HEAD and refs:

    Repository.getHead
    RevisionWalker.pushHead
    RevisionWalker.pushRef
    RevisionWalker.hideHead
    RevisionWalker.hideRef
    
  • Support for prettifying a Message.

That's all for now ;)
Anyway, it should be great to have a wiki page that people
can edit to add and assign himself tasks, instead of a TODO.md.

How to create the tree for creating a commit?

I'm able to create a Blob, and I see a repository.createCommit call, which requires you to pass in a Tree. However, how do you create the tree for a commit? The createTree() call is not yet implemented.

However, I assume I should be able to do it by hand. And yet, I don't have access to the TreeEntry object to stuff the Blob object into. I also don't seem to have access to Signature for the commit as well. I assume it should look something like (in coffeescript):

repo = gitteh.openRepository('some/path.git')
refHead = repo.getReference('HEAD').resolve()

blob = repo.createBlob({ data: new Buffer("some data") })

// how to access TreeEntry?
treeEntry = new gitteh.TreeEntry({ name: "blob.txt", id: blob.id })

tree = new gitteh.Tree({ entries: [treeEntry] })

// how to get Signature?
commit = repo.createCommit({
  author: new gitteh.Signature({ name: "wil", email: "[email protected]" })
  parents: [refHead.target]
  message: "some commit message"
  tree: tree
})

And also, this seems like you have to recreate the entire tree in order to commit. That seems like a pain given that usually you just want to commit changed files. How do you commit changed files?

Is a callback required for 0.17.1?

Older versions of gitteh had an optional callback, like for openRepository().

However, just installing gitteh 0.17.1 on node 0.8.25, it seems like openRepository() now requires a callback:

coffee> repo = gitteh.openRepository("path/to/repo.git")
Error: Not enough arguments.
    at module.exports.fn (/Users/iamwil/projects/code/cubehero/node_modules/gitteh/lib/args.js:53:13)
    at Object.Gitteh.openRepository (/Users/iamwil/projects/code/cubehero/node_modules/gitteh/lib/gitteh.js:898:12)
    at evalmachine.<anonymous>:3:20
    at Object.exports.eval (/Users/iamwil/.nvm/v0.8.25/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:146:17)
    at Interface.run (/Users/iamwil/.nvm/v0.8.25/lib/node_modules/coffee-script/lib/coffee-script/repl.js:145:41)
    at Interface.EventEmitter.emit (events.js:96:17)
    at Interface._onLine (readline.js:200:10)
    at Interface._line (readline.js:518:8)
    at Interface._ttyWrite (readline.js:736:14)
    at ReadStream.onkeypress (readline.js:97:10)

However, the documentation doesn't reflect this requirement. I'm wondering, is this a bug, or is the documentation now incorrect?

Async seems to fail randomly...

I'm attempting to write an HTTP serving layer using this lib. Great stuff so far, but I've come across some of the callbacks not getting their return objects filled out properly (everything being set to 0 or null). This test case demonstrates:

var gitteh = require('gitteh');

var repo = gitteh.openRepository('./.git');
var i = 100;
var good = 0;
var bad = 0;
while (i--) {
  repo.getCommit("271015640405704dc7f7a2a5ad5510602174d7cf", function(err, commit) {
    if (err) throw err;
    if (commit.message === null) {
      bad++;
    } else {
      good++;
    }
  });
}

process.on('exit', function() {
  console.error("Good:", good);
  console.error("Bad:", bad);
});

Hopefully you can get a chance to fix it soon, because otherwise my HTTP layer is working! Thanks in advance!

Tree::Save()

Hi, are there some reasons not to implement Tree::Save() method?
I noticed that it existed in previous revisions and now it's removed.

Fails to build on Mac OS X...

This is on Snow Leopard. And yes, I have libgit2 v0.10.0 installed...

Waf: Entering directory `/Users/nrajlich/node-gitteh/build'
[ 2/12] cxx: src/commit.cc -> build/default/src/commit_1.o
[ 3/12] cxx: src/tree.cc -> build/default/src/tree_1.o
../src/object_store.h: In member function ‘bool gitteh::ObjectStore<T, S>::getObjectFor(S*, T**) [with T = gitteh::Tree, S = git_tree]’:
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Repository, T = gitteh::Tree, S = git_tree]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Repository, T = gitteh::Tree, S = git_tree]’
../src/commit.cc:137:   instantiated from here
../src/object_store.h:50: error: cast from ‘git_tree*’ to ‘int’ loses precision
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Repository, T = gitteh::Tree, S = git_tree]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Repository, T = gitteh::Tree, S = git_tree]’
../src/commit.cc:137:   instantiated from here
../src/object_store.h:67: error: cast from ‘git_tree*’ to ‘int’ loses precision
../src/object_store.h: In member function ‘bool gitteh::ObjectStore<T, S>::getObjectFor(S*, T**) [with T = gitteh::Commit, S = git_commit]’:
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Repository, T = gitteh::Commit, S = git_commit]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Repository, T = gitteh::Commit, S = git_commit]’
../src/commit.cc:288:   instantiated from here
../src/object_store.h:50: error: cast from ‘git_commit*’ to ‘int’ loses precision
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Repository, T = gitteh::Commit, S = git_commit]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Repository, T = gitteh::Commit, S = git_commit]’
../src/commit.cc:288:   instantiated from here
../src/object_store.h:67: error: cast from ‘git_commit*’ to ‘int’ loses precision
../src/object_store.h: In static member function ‘static void gitteh::ObjectStore<T, S>::WeakCallback(v8::Persistent<v8::Value>, void*) [with T = gitteh::Tree, S = git_tree]’:
../src/object_store.h:64:   instantiated from ‘bool gitteh::ObjectStore<T, S>::getObjectFor(S*, T**) [with T = gitteh::Tree, S = git_tree]’
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Repository, T = gitteh::Tree, S = git_tree]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Repository, T = gitteh::Tree, S = git_tree]’
../src/commit.cc:137:   instantiated from here
../src/object_store.h:140: error: cast from ‘git_tree*’ to ‘int’ loses precision
../src/object_store.h: In static member function ‘static void gitteh::ObjectStore<T, S>::WeakCallback(v8::Persistent<v8::Value>, void*) [with T = gitteh::Commit, S = git_commit]’:
../src/object_store.h:64:   instantiated from ‘bool gitteh::ObjectStore<T, S>::getObjectFor(S*, T**) [with T = gitteh::Commit, S = git_commit]’
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Repository, T = gitteh::Commit, S = git_commit]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Repository, T = gitteh::Commit, S = git_commit]’
../src/commit.cc:288:   instantiated from here
../src/object_store.h:140: error: cast from ‘git_commit*’ to ‘int’ loses precision
../src/object_store.h: In member function ‘void gitteh::ObjectStore<T, S>::deleteObjectFor(S*) [with T = gitteh::TreeEntry, S = git_tree_entry]’:
../src/object_factory.h:69:   instantiated from ‘void gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::deleteObject(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/tree.cc:350:   instantiated from here
../src/object_store.h:82: error: cast from ‘git_tree_entry*’ to ‘int’ loses precision
../src/object_factory.h:69:   instantiated from ‘void gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::deleteObject(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/tree.cc:350:   instantiated from here
../src/object_store.h:89: error: cast from ‘git_tree_entry*’ to ‘int’ loses precision
../src/object_store.h: In member function ‘bool gitteh::ObjectStore<T, S>::getObjectFor(S*, T**) [with T = gitteh::TreeEntry, S = git_tree_entry]’:
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/tree.cc:151:   instantiated from here
../src/object_store.h:50: error: cast from ‘git_tree_entry*’ to ‘int’ loses precision
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/tree.cc:151:   instantiated from here
../src/object_store.h:67: error: cast from ‘git_tree_entry*’ to ‘int’ loses precision
../src/object_store.h: In static member function ‘static void gitteh::ObjectStore<T, S>::WeakCallback(v8::Persistent<v8::Value>, void*) [with T = gitteh::TreeEntry, S = git_tree_entry]’:
../src/object_store.h:64:   instantiated from ‘bool gitteh::ObjectStore<T, S>::getObjectFor(S*, T**) [with T = gitteh::TreeEntry, S = git_tree_entry]’
../src/object_factory.h:76:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::wrap(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/object_factory.h:56:   instantiated from ‘T* gitteh::ObjectFactory< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::syncRequestObject(S*) [with P = gitteh::Tree, T = gitteh::TreeEntry, S = git_tree_entry]’
../src/tree.cc:151:   instantiated from here
../src/object_store.h:140: error: cast from ‘git_tree_entry*’ to ‘int’ loses precision
Waf: Leaving directory `/Users/nrajlich/node-gitteh/build'
Build failed:
 -> task failed (err #1): 
    {task: cxx commit.cc -> commit_1.o}
 -> task failed (err #1): 
    {task: cxx tree.cc -> tree_1.o}

Project status

Hi everyone,

there hasn't been activity for quite a while now. In some other issue i found a "working on that".

Is there a major rewrite underway? Is it close to release or will it be released "when it's done"?

Or is the project inactive atm?

I am stating a project ATM and wonder whether i should use gitteh or an other git backend.

Greetz

Need a built-in way to list tags and branches for a repo.

I know this is already on your todo list, I'm just making an official Issue for it so that I can be notified when you implement it...

But we need a way to find all available tags and branches for a Repository instance. Returning a simple Array with the names would suffice IMO (or an object that also contained the SHA of the commit would also rock).

can't install by npm commit.cc:213:63: error

Waf: Leaving directory /usr/local/lib/node_modules/gitteh/vendor/libgit2/build/static' 'build-static' finished successfully (0.047s) [ 1/11] cxx: src/gitteh.cc -> build/Release/src/gitteh_1.o [ 2/11] cxx: src/commit.cc -> build/Release/src/commit_1.o ../src/commit.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Commit::SaveObject(v8::Handle<v8::Object>, gitteh::Repository*, v8::Handle<v8::Value>, bool)’: ../src/commit.cc:213:63: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’ ../src/commit.cc:213:63: error: initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’ Waf: Leaving directory/usr/local/lib/node_modules/gitteh/build'
Build failed: -> task failed (err #1):
{task: cxx commit.cc -> commit_1.o}

Gitteh Builds Fail On Mac OS X

For whatever reason, it appears that the default build of Gitteh on Mac OS X installs to the wrong place. I think the problem has to do with the Development / Release build schemes model in Xcode.

The following series of commands seem to fix the problem on my machine:

cd path/to/my/project/dir
mkdir node_modules
sudo npm install gitteh
ln -s `pwd`/node_modules/gitteh/build/Release \
  node_modules/gitteh/build/default

windows

its using the older node-waf. There is not node.gyp bindings.

is this designed to work on windows at all ?

No suitable image found (Mac OSX)

Following #31, now i'm getting other error:

module.js:485
process.dlopen(filename, module.exports);
      ^
Error: dlopen(/pwd/node_modules/gitteh/build/Release/gitteh.node, 1): no suitable image found.  Did find:
/pwd/node_modules/gitteh/build/Release/gitteh.node: mach-o, but wrong architecture
at Object.Module._extensions..node (module.js:485:11)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/pwd/node_modules/gitteh/lib/gitteh.js:1:80)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

MacOSX v10.7, Node v0.8.17

Any idea for this?

a new release with latest libgit2 release?

Currently gitteh's libgit2 submodule is at 6dcb09b libgit2 version 0.11.0, "McSwifty".

Since then there have been these releases/tags of libgit2:

52e50c1 libgit2 v0.14.0, "watermelon wheat"
...
3717258 libgit2 v0.13.0 "Watermelon Wheat"
...
4077454 libgit2 v0.12.0 "absolutely no reason"
...

Are there plans to update that and push a new gitteh release to npm? I'm hoping to get a new gitteh release that includes libgit2 with the fix for building on Solaris (libgit2/libgit2#138) from a couple of months ago.

Thanks,
Trent

How is lib/gitteh.js generated?

It's in the NPM tarball, it's not in the repo, preinstall.js and install.js don't generate it. Additionally what is the correct way to manually build the tarball, node-gyp, npm and direct use of the install.js are all mentioned in various issues and parts of docs but nothing seems to be correct and produce a workable package. Thanks.

Distinguish between tags and branches

> repo.getReference("refs/tags/v12.7.13.0")
{ name: 'refs/tags/v12.7.13.0',
  type: 1,
  target: '19a3b7da38701f6899d98c90f22a9a4b38a82772' }
> repo.getReference("refs/heads/develop")
{ name: 'refs/heads/develop',
  type: 1,
  target: '0f79cea83a9f17b6829529bb9ebd0d47726220bd' }

If I do repo.getCommit(repo.getReference("refs/tags/v12.7.13.0").resolve().target) I get an error, but I can getTag(). There needs to be a way to determine if a reference is a tag or a commit.

repository.listReferences() returns empty array

First of all, thank you for such a great module!

I tried to list all references with repository.listReferences(). Also I had three tags, some branches etc. , an empty array returned. Is it a bug? or I misunderstood this function.

A bug in walker::next()

I have this function:

Wiki.prototype.pageHistory = function(page,depth,callback){

    var pageEntry,pageId;

    var history    = [];
    var pageLastId = 0;
    var repo       = this.repo;
    var head       = this.head;
    var walker     = repo.createWalker();
    depth          = depth || Infinity;
    page           = convertTitleToFilename(page);

    var diveIntoHistory = function(err,commit){
        if(err){
            callback(err);
            return;
        }

        if(depth == 0 || commit == null){
            callback(null,history);
            return;
        }

        depth--;

        repo.getTree(commit.tree,function(err,treeObj){

          if(err){
              callback(err);
              return;
          }

          pageEntry = treeObj.entries.filter(function(elem){
              return (elem.name == page);
          }).pop();

          if(!pageEntry){
              callback(null,history);
              return;
          }

          pageId = pageEntry.id;
          if(pageId != pageLastId){
              pageLastId = pageId;
              history.push({
                commit  : commit.id,
                author  : commit.author.name,
                email   : commit.author.time,
                message : commit.message
              });
          }
          //@FIXME there is a bug in gitteh when calling next async.
          //walker.next(diveIntoHistory);

          var next = walker.next();
          diveIntoHistory(null,next);
        });
    }

    walker.sort(gitteh.GIT_SORT_TIME,function(err){
        if(err){
          callback(err);
          return;
        }
        walker.push(head,function(err){
            if(err){
                callback(err);
                return;
            }
            walker.next(diveIntoHistory);
        });
    });
}

When I call next asynchronously, gitteh calls callback function ( diveIntoHistory ) twice.

Synchronous openRepository Fails

I try opening a repository like so:

var repo =  gitteh.openRepository(".git");

and receive:

node_modules/gitteh/lib/args.js:33
     throw new Error("Not enough arguments.");
Error: Not enough arguments.

Cannot compile latest version of gitteh or v0.1.0

As you know, you currently can't npm install gitteh.

Since the last version of libgit2 that gitteh is compatible with (v0.16.0) is unavailable on brew (for macs), and a pre-compiled package doesn't exist for ubuntu, I'm trying to compile it myself.

As far as I can tell, to compile:

node-waf configure --use-bundled-libgit2 && node-waf build

However, I can't, since gitteh seem to barf when compiling libgit2. It seems like the submodule version it checks out is always the latest, rather than fixing it to a particular commit, and thus, the latest libgit2 v0.17.0 is incompatible with gitteh v0.1.0

If I'm trying to compiile v0.1.0 (the last release on npm), which version (or commit) of libgit2 should I get so that the build scripts work?

And in addition, how is the progression on the next version of gitteh that's compatible with libgit2 v0.17.0 progressing? Should I switch to a different git library? I see in the other issues threads that a year ago, you stopped work on gitteh, and you're using node-git now. However, in the latest posts and the recent commits (about a month ago) indicate that you were working on a new release?

Need some kind of high level "rev-parse" functionality.

It would be great to get some sort of "rev-parse" functionality that you could pass any revision identifier to and have it resolve to a SHA hash. Maybe something like:

// Resolve 'HEAD', asynchronous
repo.revParse("HEAD", function(err, sha) {
  if (err) throw err;
  repo.getCommit(sha, function(err, commit) {
    // Blah
  });
});

// Resolve the tag 'v1.0.0', synchronous
var sha = repo.revParse("v1.0.0");

// Resolve to an oid and get raw Buffer
repo.getRawObject(repo.revParse("HEAD:package.json")).data;

// This would be awesome too:
// All should return: 37d671c8470ca723b951d25dd882186ec6c65c28
repo.revParse("37d671c8470ca723b951d25d");
repo.revParse("37d671c8470ca72");
repo.revParse("37d671c");

Thoughts?

Build location error

When i try to require('gitteh') i run into this error:

module.js:340
throw err;
^
Error: Cannot find module '../build/default/gitteh'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)

I can get past this by moving gitteh from build/Release/gitteh to build/default/gitteh
Should be an easy fix but idk how to do it.

index_entry.cc is missing

I tried building node-gitteh with node-waf, and it turns out that wscript is requesting a file in the src folder called "index_entry.cc"; the problem here is that index_entry.cc is missing from the repository.

Does anyone have that file?

Edit: commit id: 67cecd5

{ [Error: This transport isn't implemented. Sorry] code: 11 }

I made a slight modification to the examples/show_remote.js,

var gitteh = require("../lib/gitteh");
var path = require("path");

gitteh.openRepository(path.join(__dirname, ".."), function(err, repo) {
    exports.repo = repo;

    repo.remote("origin", function(err, remote) {
        exports.remote = remote;

        remote.connect("fetch", function(err) {
            if(err) return console.error(err);
            console.log(remote);
            console.log(remote.connected);
            console.log(remote.refs);
        });
    });
});

When I running it , I got this error:

{ [Error: This transport isn't implemented. Sorry] code: 11 }

openRepository doesn't return repository object in callback

In the documentation for openRepository in gitteh, it says that there's an optional callback as the last argument.

{Function} callback Optional
If provided, the repository will be opened asynchronously, and the provided callback will be fired when the repository has been > opened.

However, the callback doesn't pass the repository object that it just opened. Without a reference, there's not much this callback is useful for, other than an alert.

I've duplicated the example to open up a repo to get a commit, using the code below:

gitteh.openRepository "repos/my_repo", (repo) ->
  console.log("repo: %j", repo)
  repo.getReference "HEAD", (refHead) -> # Fails at this line, because repo is null
    refHead = refHead.resolve() (refHead) ->
    console.log("refHead: %j", refHead)
    repo.getCommit refHead.target, (commit) ->
      console.log("commit: %j", commit)

Is there another way to do this, or is this a bug?

Cannot install gitteh with libgit2 0.17.0

I can't install gitteh with npm.

It seems like there are missing headers that gitteh needs from libgit2.

Here's the output from npm:

 > npm install gitteh
npm http GET https://registry.npmjs.org/gitteh
npm http 304 https://registry.npmjs.org/gitteh

> [email protected] preinstall /Users/iamwil/Dropbox/projects/code/oneofthesethings/server/node_modules/gitteh
> node-waf configure

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local/Cellar/node/0.6.11 
Checking for program git                 : /usr/local/bin/git 
Checking for library git2                : yes 
'configure' finished successfully (0.166s)
npm http GET https://registry.npmjs.org/vows
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/async
npm http 200 https://registry.npmjs.org/vows
npm http 200 https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/glob/-/glob-3.1.10.tgz
npm http 200 https://registry.npmjs.org/glob/-/glob-3.1.10.tgz
npm http 200 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/eyes
npm http 200 https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/eyes
npm WARN [email protected] dependencies field should be hash of <name>:<version-range> pairs
npm http 200 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/lru-cache
npm http 200 https://registry.npmjs.org/lru-cache

> [email protected] install /Users/iamwil/Dropbox/projects/code/oneofthesethings/server/node_modules/gitteh
> node-waf build

Waf: Entering directory `/Users/iamwil/Dropbox/projects/code/oneofthesethings/server/node_modules/gitteh/build'
[ 1/11] cxx: src/gitteh.cc -> build/Release/src/gitteh_1.o
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
 /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/cc1plus -quiet -v -IRelease -I.. -I/usr/local/Cellar/node/0.6.11/include/node -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/ -D__DYNAMIC__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE ../src/gitteh.cc -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase gitteh.cc -mmacosx-version-min=10.7 -m64 -mtune=core2 -auxbase-strip Release/src/gitteh_1.o -g -version -fPIC -D__private_extern__=extern -o /var/folders/sz/ggjf23bx6h33wfmnst3sv9mw0000gn/T//ccQnikYQ.s
[ 2/11] cxx: src/commit.cc -> build/Release/src/commit_1.o
[ 3/11] cxx: src/tree.cc -> build/Release/src/tree_1.o
ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64"
ignoring nonexistent directory "/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
#include "..." search starts here:
#include <...> search starts here:
 Release
 ..
 /usr/local/Cellar/node/0.6.11/include/node
 /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include/c++/4.2.1
 /usr/include/c++/4.2.1/backward
 /usr/local/include
 /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
GNU C++ version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) (i686-apple-darwin11)
    compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
 /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/cc1plus -quiet -v -IRelease -I.. -I/usr/local/Cellar/node/0.6.11/include/node -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/ -D__DYNAMIC__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE ../src/commit.cc -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase commit.cc -mmacosx-version-min=10.7 -m64 -mtune=core2 -auxbase-strip Release/src/commit_1.o -g -version -fPIC -D__private_extern__=extern -o /var/folders/sz/ggjf23bx6h33wfmnst3sv9mw0000gn/T//ccPp9BRH.s
Compiler executable checksum: 76574dd1d5b8332871d5e52f294fb6e5
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
 /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/cc1plus -quiet -v -IRelease -I.. -I/usr/local/Cellar/node/0.6.11/include/node -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/ -D__DYNAMIC__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE ../src/tree.cc -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase tree.cc -mmacosx-version-min=10.7 -m64 -mtune=core2 -auxbase-strip Release/src/tree_1.o -g -version -fPIC -D__private_extern__=extern -o /var/folders/sz/ggjf23bx6h33wfmnst3sv9mw0000gn/T//cc3sSwDg.s
ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64"
ignoring nonexistent directory "/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
#include "..." search starts here:
#include <...> search starts here:
 Release
 ..
 /usr/local/Cellar/node/0.6.11/include/node
 /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include/c++/4.2.1
 /usr/include/c++/4.2.1/backward
 /usr/local/include
 /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
GNU C++ version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) (i686-apple-darwin11)
    compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
Compiler executable checksum: 76574dd1d5b8332871d5e52f294fb6e5
ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64"
ignoring nonexistent directory "/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
#include "..." search starts here:
#include <...> search starts here:
 Release
 ..
 /usr/local/Cellar/node/0.6.11/include/node
 /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include/c++/4.2.1
 /usr/include/c++/4.2.1/backward
 /usr/local/include
 /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
GNU C++ version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) (i686-apple-darwin11)
    compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
[ 4/11] cxx: src/repository.cc -> build/Release/src/repository_1.o
Compiler executable checksum: 76574dd1d5b8332871d5e52f294fb6e5
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
 /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/cc1plus -quiet -v -IRelease -I.. -I/usr/local/Cellar/node/0.6.11/include/node -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/ -D__DYNAMIC__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE ../src/repository.cc -fPIC -feliminate-unused-debug-symbols -quiet -dumpbase repository.cc -mmacosx-version-min=10.7 -m64 -mtune=core2 -auxbase-strip Release/src/repository_1.o -g -version -fPIC -D__private_extern__=extern -o /var/folders/sz/ggjf23bx6h33wfmnst3sv9mw0000gn/T//cc1wGwbH.s
ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64"
ignoring nonexistent directory "/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
#include "..." search starts here:
#include <...> search starts here:
 Release
 ..
 /usr/local/Cellar/node/0.6.11/include/node
 /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include/c++/4.2.1
 /usr/include/c++/4.2.1/backward
 /usr/local/include
 /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
GNU C++ version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) (i686-apple-darwin11)
    compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
Compiler executable checksum: 76574dd1d5b8332871d5e52f294fb6e5
In file included from ../src/repository.h:4,
                 from ../src/tree.cc:25:
../src/gitteh.h: In function ‘bool gitteh::LoadOidArg(const v8::Arguments&, int, git_oid*)’:
../src/gitteh.h:125: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/gitteh.h: In function ‘v8::Handle<v8::Value> gitteh::CreateGitError(v8::Handle<v8::String>, int)’:
../src/gitteh.h:137: error: ‘git_strerror’ was not declared in this scope
In file included from ../src/gitteh.cc:25:
../src/gitteh.h: In function ‘bool gitteh::LoadOidArg(const v8::Arguments&, int, git_oid*)’:
../src/gitteh.h:125: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/gitteh.h: In function ‘v8::Handle<v8::Value> gitteh::CreateGitError(v8::Handle<v8::String>, int)’:
../src/gitteh.h:137: error: ‘git_strerror’ was not declared in this scope
In file included from ../src/repository.h:4,
                 from ../src/repository.cc:25:
../src/gitteh.h: In function ‘bool gitteh::LoadOidArg(const v8::Arguments&, int, git_oid*)’:
../src/gitteh.h:125: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/gitteh.h: In function ‘v8::Handle<v8::Value> gitteh::CreateGitError(v8::Handle<v8::String>, int)’:
../src/gitteh.h:137: error: ‘git_strerror’ was not declared in this scope
In file included from ../src/commit.h:4,
                 from ../src/commit.cc:25:
../src/gitteh.h: In function ‘bool gitteh::LoadOidArg(const v8::Arguments&, int, git_oid*)’:
../src/gitteh.h:125: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/gitteh.h: In function ‘v8::Handle<v8::Value> gitteh::CreateGitError(v8::Handle<v8::String>, int)’:
../src/gitteh.h:137: error: ‘git_strerror’ was not declared in this scope
In file included from ../src/gitobjectwrap_new.h:5,
                 from ../src/commit.h:5,
                 from ../src/gitteh.cc:27:
../src/object_cache.h: In member function ‘v8::Handle<v8::Value> gitteh::WrappedGitObjectCache<T, S>::syncRequest(S*)’:
../src/object_cache.h:33: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h: In member function ‘int gitteh::WrappedGitObjectCache<T, S>::wrap(S*, T**)’:
../src/object_cache.h:158: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h:161: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/repository.h:5,
                 from ../src/tree.cc:25:
../src/object_cache.h: In member function ‘v8::Handle<v8::Value> gitteh::WrappedGitObjectCache<T, S>::syncRequest(S*)’:
../src/object_cache.h:33: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/commit.h:5,
                 from ../src/gitteh.cc:27:
../src/gitobjectwrap_new.h: In member function ‘int gitteh::WrappedGitObject<T, S>::initialize(S*)’:
../src/gitobjectwrap_new.h:61: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/gitobjectwrap_new.h:83: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h: In member function ‘int gitteh::WrappedGitObjectCache<T, S>::wrap(S*, T**)’:
../src/object_cache.h:158: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h:161: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/tree.h:5,
                 from ../src/tree.cc:26:
../src/gitobjectwrap_new.h: In member function ‘int gitteh::WrappedGitObject<T, S>::initialize(S*)’:
../src/gitobjectwrap_new.h:61: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/gitobjectwrap_new.h:83: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/repository.h:5,
                 from ../src/repository.cc:25:
../src/object_cache.h: In member function ‘v8::Handle<v8::Value> gitteh::WrappedGitObjectCache<T, S>::syncRequest(S*)’:
../src/object_cache.h:33: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h: In member function ‘int gitteh::WrappedGitObjectCache<T, S>::wrap(S*, T**)’:
../src/object_cache.h:158: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h:161: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/gitteh.cc:34:
../src/error.h: In function ‘void gitteh::ErrorInit(v8::Handle<v8::Object>)’:
../src/error.h:13: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/error.h:15: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/error.h:17: error: ‘GIT_ENOMEM’ was not declared in this scope
../src/error.h:18: error: ‘GIT_EOSERR’ was not declared in this scope
../src/error.h:19: error: ‘GIT_EOBJTYPE’ was not declared in this scope
../src/error.h:20: error: ‘GIT_EOBJCORRUPTED’ was not declared in this scope
../src/error.h:21: error: ‘GIT_ENOTAREPO’ was not declared in this scope
../src/error.h:22: error: ‘GIT_EINVALIDTYPE’ was not declared in this scope
../src/error.h:23: error: ‘GIT_EMISSINGOBJDATA’ was not declared in this scope
../src/error.h:24: error: ‘GIT_EPACKCORRUPTED’ was not declared in this scope
../src/error.h:25: error: ‘GIT_EFLOCKFAIL’ was not declared in this scope
../src/error.h:26: error: ‘GIT_EZLIB’ was not declared in this scope
../src/error.h:27: error: ‘GIT_EBUSY’ was not declared in this scope
../src/error.h:28: error: ‘GIT_EBAREINDEX’ was not declared in this scope
In file included from ../src/commit.h:5,
                 from ../src/repository.cc:26:
../src/gitobjectwrap_new.h: In member function ‘int gitteh::WrappedGitObject<T, S>::initialize(S*)’:
../src/gitobjectwrap_new.h:61: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/error.h:29: error: ‘GIT_EINVALIDREFNAME’ was not declared in this scope
../src/error.h:30: error: ‘GIT_EREFCORRUPTED’ was not declared in this scope
../src/gitobjectwrap_new.h:83: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/error.h:31: error: ‘GIT_ETOONESTEDSYMREF’ was not declared in this scope
../src/error.h:32: error: ‘GIT_EPACKEDREFSCORRUPTED’ was not declared in this scope
../src/error.h:33: error: ‘GIT_EINVALIDPATH’ was not declared in this scope
../src/error.h:34: error: ‘GIT_EREVWALKOVER’ was not declared in this scope
../src/error.h:35: error: ‘GIT_EINVALIDREFSTATE’ was not declared in this scope
../src/error.h:36: error: ‘GIT_ENOTIMPLEMENTED’ was not declared in this scope
In file included from ../src/gitobjectwrap_new.h:5,
                 from ../src/commit.h:5,
                 from ../src/commit.cc:25:
../src/object_cache.h: In member function ‘v8::Handle<v8::Value> gitteh::WrappedGitObjectCache<T, S>::syncRequest(S*)’:
../src/object_cache.h:33: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/tree.cc: In member function ‘virtual int gitteh::Tree::doInit()’:
../src/tree.cc:204: error: ‘GIT_SUCCESS’ was not declared in this scope../src/object_cache.h: In member function ‘int gitteh::WrappedGitObjectCache<T, S>::wrap(S*, T**)’:
../src/object_cache.h:158: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/object_cache.h:161: error: ‘GIT_SUCCESS’ was not declared in this scope

In file included from ../src/commit.h:5,
                 from ../src/commit.cc:25:
../src/gitobjectwrap_new.h: In member function ‘int gitteh::WrappedGitObject<T, S>::initialize(S*)’:
../src/gitobjectwrap_new.h:61: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/gitteh.cc:35:
../src/ref.h: At global scope:
../src/ref.h:39: error: ‘git_rtype’ does not name a type
../src/gitobjectwrap_new.h:83: error: ‘GIT_SUCCESS’ was not declared in this scope
In file included from ../src/repository.cc:31:
../src/ref.h: At global scope:
../src/ref.h:39: error: ‘git_rtype’ does not name a type
../src/commit.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Commit::SaveObject(v8::Handle<v8::Object>, gitteh::Repository*, v8::Handle<v8::Value>, bool)’:
../src/commit.cc:142: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc:147: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc:177: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc:184: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc:249: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::OpenRepository(const v8::Arguments&)’:
../src/repository.cc:396: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc: In static member function ‘static void gitteh::Commit::EIO_Save(eio_req*)’:
../src/commit.cc:309: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc:425: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc: In static member function ‘static int gitteh::Commit::EIO_AfterSave(eio_req*)’:
../src/commit.cc:330: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/commit.cc: In member function ‘virtual int gitteh::Commit::doInit()’:
../src/commit.cc:392: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::InitRepository(const v8::Arguments&)’:
../src/repository.cc:565: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::GetCommit(const v8::Arguments&)’:
../src/repository.cc:692: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/repository.cc:700: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_GetCommit(eio_req*)’:
../src/repository.cc:714: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnCommit(eio_req*)’:
../src/repository.cc:735: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::GetTree(const v8::Arguments&)’:
../src/repository.cc:768: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/repository.cc:776: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_GetTree(eio_req*)’:
../src/repository.cc:790: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnTree(eio_req*)’:
../src/repository.cc:811: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::GetTag(const v8::Arguments&)’:
../src/repository.cc:853: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/repository.cc:861: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_GetTag(eio_req*)’:
../src/repository.cc:875: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnTag(eio_req*)’:
../src/repository.cc:896: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::CreateWalker(const v8::Arguments&)’:
../src/repository.cc:927: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::GetIndex(const v8::Arguments&)’:
../src/repository.cc:971: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnIndex(eio_req*)’:
../src/repository.cc:996: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::GetReference(const v8::Arguments&)’:
../src/repository.cc:1030: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_GetReference(eio_req*)’:
../src/repository.cc:1049: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnReference(eio_req*)’:
../src/repository.cc:1073: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::GetBlob(const v8::Arguments&)’:
../src/repository.cc:1099: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/repository.cc:1107: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_GetBlob(eio_req*)’:
../src/repository.cc:1121: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnBlob(eio_req*)’:
../src/repository.cc:1142: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::CreateSymbolicRef(const v8::Arguments&)’:
../src/repository.cc:1192: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_CreateSymbolicRef(eio_req*)’:
../src/repository.cc:1214: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::CreateOidRef(const v8::Arguments&)’:
../src/repository.cc:1236: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/repository.cc:1259: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_CreateOidRef(eio_req*)’:
../src/repository.cc:1285: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::ListReferences(const v8::Arguments&)’:
../src/repository.cc:1323: error: ‘git_reference_listall’ was not declared in this scope
../src/repository.cc:1326: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_GetRefList(eio_req*)’:
../src/repository.cc:1347: error: ‘git_reference_listall’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_AfterGetRefList(eio_req*)’:
../src/repository.cc:1359: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In member function ‘int gitteh::Repository::DoRefPacking()’:
../src/repository.cc:1418: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::PackReferences(const v8::Arguments&)’:
../src/repository.cc:1462: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_AfterPackRefs(eio_req*)’:
../src/repository.cc:1484: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static v8::Handle<v8::Value> gitteh::Repository::Exists(const v8::Arguments&)’:
../src/repository.cc:1506: error: ‘GIT_ENOTOID’ was not declared in this scope
../src/repository.cc: In static member function ‘static void gitteh::Repository::EIO_CreateRevWalker(eio_req*)’:
../src/repository.cc:1544: error: ‘GIT_SUCCESS’ was not declared in this scope
../src/repository.cc: In static member function ‘static int gitteh::Repository::EIO_ReturnRevWalker(eio_req*)’:
../src/repository.cc:1545: error: ‘GIT_SUCCESS’ was not declared in this scope
Waf: Leaving directory `/Users/iamwil/Dropbox/projects/code/oneofthesethings/server/node_modules/gitteh/build'
Build failed:
 -> task failed (err #1): 
    {task: cxx gitteh.cc -> gitteh_1.o}
 -> task failed (err #1): 
    {task: cxx tree.cc -> tree_1.o}
 -> task failed (err #1): 
    {task: cxx commit.cc -> commit_1.o}
 -> task failed (err #1): 
    {task: cxx repository.cc -> repository_1.o}
npm ERR! error installing [email protected]

npm ERR! [email protected] install: `node-waf build`
npm ERR! `sh "-c" "node-waf build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the gitteh package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf build
npm ERR! You can get their info via:
npm ERR!     npm owner ls gitteh
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "gitteh"
npm ERR! cwd /Users/iamwil/Dropbox/projects/code/oneofthesethings/server
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.2
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-waf build`
npm ERR! message `sh "-c" "node-waf build"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/iamwil/Dropbox/projects/code/oneofthesethings/server/npm-debug.log
npm not ok

throws std::logic_error

I have a very simple node.js script that runs through the commit history for a large git repository, printing out the commit ID. Part of the way through I get the following error:

ca912b17c0af886d9090449d5933ac6ca9a7a20f
766f0378a745596eae0bb625b9e3f05a7e7be476
22f9740552b89c9f458f972f881d222b298ab165
2eec62d7dbaa8ed0terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
Abort trap

Here is the code

var gitteh = require('gitteh');

var repository = gitteh.openRepository('/Users/nwatkins/Projects/Linux/linux-2.6/.git');
var headRef = repository.getReference('HEAD').resolve();
var walker = repository.createWalker();

walker.sort(gitteh.GIT_SORT_TIME);
walker.push(headRef.target);

while (true) {
    commit = walker.next();
    if (!commit)
        break;

    console.log(commit.id);
};

treeObject.removeEntry() Bug

There is a bug in removing entry by its name. removeEntry always checks the first argument to be integer. But in the source file, removing entry by its name is possible.

In src/tree.cc line 284, REQ_INT_ARG should be removed.

Offer a ReadableStream/WritableStream interface to work getRawObject blobs...

This is more of a feature request / API suggestion:

Ideally, especially for very large files (or in the case of git, blobs), http responses should be streamed back to the client. In node, this is ideally done with Stream#pipe().

Currently with node-gitteh, streaming a revision of a file over a socket or to a file is impossible. I suggest that you offer a way to create both a ReadableStream and WritableStream that would work with a Repository instance's RawObjects. These streams would be very similar to their fs module counterparts.

Perhaps something like:

var readStream = repo.createRawReadStream(id);
readStream.pipe(fs.createWriteStream("file.dump"));

for a read stream would be cool. The stream would periodically emit data events. Then we could easily pipe the contents of a blob to a file, or socket, or http response, or whatever. Let me know what you think. Thanks!

Warnings given when building gitteh

I was able to build gitteh on macox 10.7.5 with xcode 4.6.2. npm 1.1.4 and node 0.6.12

But I got these warnings about unused values. Here's a sample below, FYI. Are these something to worry about?

In file included from /Users/orgtag/Dropbox/projects/scratch/test_gitteh/node_modules/gitteh/vendor/libgit2/tests/t18-status.c:26:
In file included from /Users/orgtag/Dropbox/projects/scratch/test_gitteh/node_modules/gitteh/vendor/libgit2/tests/test_lib.h:9:
In file included from /Users/orgtag/Dropbox/projects/scratch/test_gitteh/node_modules/gitteh/vendor/libgit2/src/common.h:57:
/Users/orgtag/Dropbox/projects/scratch/test_gitteh/node_modules/gitteh/vendor/libgit2/src/util.h:71:14: warning: expression result unused [-Wunused-value]
                git__throw(GIT_ENOMEM, "Out of memory. Failed to allocate %d bytes.", (int)size);
                           ^~~~~~~~~~
/Users/orgtag/Dropbox/projects/scratch/test_gitteh/node_modules/gitteh/vendor/libgit2/src/common.h:51:29: note: expanded from macro 'git__throw'
        (git___throw(__VA_ARGS__), error)
                                   ^
5 warnings generated.

API to interact with remotes?

Is there / are there plans to implement an API to interact with the remotes of a git repo? I have a case where it would be nice to programmatically do a git fetch (that is, without spawning a child process).

Gitteh npm package will not install

Node v0.8 changed it's build system from node-waf to node-gyp. Any plans to modify the npm package? In the meantime I'll just install from the current master which appears to handle node-gyp.

Proper Documentation

Gitteh needs some proper documentation.

Given that the bindings are wholly implemented in C++ land, I'm loathe to try and get some weird doxygen setup or something to work and document the JS exposed bindings.

I think the best bet is to create a set of Javascript dummy files that correlate to the functionality offered in C++ land, then I can just attach empty functions to prototypes, document them, and run a documentation tool on that.

Revision Walking

Does the latest refactored code support revision walking? I cloned and compiled the code on my machine from the master branch and after running cake build, the gitteh.js file created didn't have any method to create a walker on the Repository object. Can you please let me know if I went wrong somewhere or whether it will be added in the future?

do I need to run cake build?

Installed nodejs using macports,
installed gitteh using package.json including "git://" url of node-gitteh

though install was successful, I can't use gitteh library because node throws error there is no js file which I could made my own using 'cake build'. but why npm script doesn't create it?

also, require still fails because there is no '../build/Debug/...' but I could find '/build/Release/...' so I needed to change coffeescript code too. why do I need to change these manually? did I something wrong?

Can't install gitteh

This is on OSX Lion latest gitteh (as of 1/24/2012)

Attempting to install via 'npm install gitteh -g'

everything fine until ..

[ 3/11] cxx: src/tree.cc -> build/Release/src/tree_1.o
[ 4/11] cxx: src/repository.cc -> build/Release/src/repository_1.o
../src/commit.cc: In static member function ‘static v8::Handlev8::Value gitteh::Commit::SaveObject(v8::Handlev8::Object, gitteh::Repository_, v8::Handlev8::Value, bool)’:
../src/commit.cc:213: error: invalid conversion from ‘int ()(eio_req)’ to ‘void ()(eio_req)’
../src/commit.cc:213: error: initializing argument 1 of ‘eio_req_ eio_custom(void ()(eio_req), int, int ()(eio_req), void*)’
../s

[...] many more similar ending with

../src/repository.cc:1539: error: invalid conversion from ‘int ()(eio_req)’ to ‘void ()(eio_req)’
../src/repository.cc:1539: error: initializing argument 1 of ‘eio_req* eio_custom(void ()(eio_req), int, int ()(eio_req), void*)’
Waf: Leaving directory /usr/local/lib/node_modules/gitteh/build' Build failed: -> task failed (err #1): {task: cxx commit.cc -> commit_1.o} -> task failed (err #1): {task: cxx repository.cc -> repository_1.o} npm ERR! error installing [email protected] npm ERR! [email protected] install:node-waf build npm ERR!sh "-c" "node-waf build"` failed with 1

gcc -v gives

Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.122/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.122/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

I had previously built successfully on SnowLeopard back in mid 2011

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.