From a93d5f199f850ac169dcf6fa266fcd3216be2b4c Mon Sep 17 00:00:00 2001 From: Morgan O'Neal Date: Thu, 8 Dec 2011 17:55:26 -0800 Subject: [PATCH 1/2] Updates for node 0.0.6x --- include/blob.h | 2 +- include/commit.h | 5 ++--- include/error.h | 1 - include/index.h | 1 - include/object.h | 3 +-- include/odb.h | 1 - include/odb_backend.h | 1 - include/oid.h | 3 +-- include/reference.h | 5 ++--- include/repo.h | 7 +++---- include/revwalk.h | 5 ++--- include/sig.h | 3 +-- include/tag.h | 1 - include/tree.h | 7 +++---- include/tree_entry.h | 3 +-- src/base.cc | 1 - src/blob.cc | 3 +-- src/commit.cc | 4 +--- src/error.cc | 1 - src/object.cc | 1 - src/oid.cc | 1 - src/reference.cc | 4 +--- src/repo.cc | 7 ++----- src/revwalk.cc | 4 +--- src/sig.cc | 1 - src/tree.cc | 7 ++----- src/tree_entry.cc | 1 - 27 files changed, 25 insertions(+), 58 deletions(-) diff --git a/include/blob.h b/include/blob.h index 5e7243c7b..34ed78b08 100755 --- a/include/blob.h +++ b/include/blob.h @@ -137,7 +137,7 @@ class GitBlob : public ObjectWrap { * Returns: * completion code integer */ - static int EIO_Lookup(eio_req* req); + static void EIO_Lookup(eio_req* req); /** * Function: EIO_AfterLookup * diff --git a/include/commit.h b/include/commit.h index e11c2cf4d..d3a4229a8 100755 --- a/include/commit.h +++ b/include/commit.h @@ -8,7 +8,6 @@ #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -23,7 +22,7 @@ using namespace v8; /** * Class wrapper for libgit2 git_commit */ -class GitCommit : public EventEmitter { +class GitCommit : public ObjectWrap { public: /** * v8::FunctionTemplate used to create Node.js constructor @@ -59,7 +58,7 @@ class GitCommit : public EventEmitter { static Handle New(const Arguments& args); static Handle Lookup(const Arguments& args); - static int EIO_Lookup(eio_req *req); + static void EIO_Lookup(eio_req *req); static int EIO_AfterLookup(eio_req *req); static Handle Close(const Arguments& args); diff --git a/include/error.h b/include/error.h index 9f730ed41..0ca2bddd0 100755 --- a/include/error.h +++ b/include/error.h @@ -7,7 +7,6 @@ #define ERROR_H #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/include/index.h b/include/index.h index ada24ca5a..03d479da9 100755 --- a/include/index.h +++ b/include/index.h @@ -7,7 +7,6 @@ #define INDEX_H #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/include/object.h b/include/object.h index 92a3914da..d84de5c05 100755 --- a/include/object.h +++ b/include/object.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -19,7 +18,7 @@ using namespace node; /** * Class wrapper for libgit2 git_object */ -class GitObject : public EventEmitter { +class GitObject : public ObjectWrap { public: /** * v8::FunctionTemplate used to create Node.js constructor diff --git a/include/odb.h b/include/odb.h index 1bdbb14d9..a0d9692cc 100755 --- a/include/odb.h +++ b/include/odb.h @@ -7,7 +7,6 @@ #define ODB_H #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/include/odb_backend.h b/include/odb_backend.h index 20a1275cc..0615cda43 100755 --- a/include/odb_backend.h +++ b/include/odb_backend.h @@ -7,7 +7,6 @@ #define ODB_BACKEND_H #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/include/oid.h b/include/oid.h index 6fd23c937..da782eddb 100755 --- a/include/oid.h +++ b/include/oid.h @@ -7,14 +7,13 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" using namespace node; using namespace v8; -class GitOid : public EventEmitter { +class GitOid : public ObjectWrap { public: static Persistent constructor_template; static void Initialize (Handle target); diff --git a/include/reference.h b/include/reference.h index ea47c1315..cbe3caf85 100755 --- a/include/reference.h +++ b/include/reference.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include #include "../vendor/libgit2/include/git2.h" @@ -18,7 +17,7 @@ Copyright (c) 2011, Tim Branyen @tbranyen using namespace node; using namespace v8; -class GitReference : public EventEmitter { +class GitReference : public ObjectWrap { public: static Persistent constructor_template; static void Initialize(Handle target); @@ -33,7 +32,7 @@ class GitReference : public EventEmitter { static Handle New(const Arguments& args); static Handle Lookup(const Arguments& args); - static int EIO_Lookup(eio_req* req); + static void EIO_Lookup(eio_req* req); static int EIO_AfterLookup(eio_req* req); static Handle Oid(const Arguments& args); diff --git a/include/repo.h b/include/repo.h index 620877a2a..c840036f4 100755 --- a/include/repo.h +++ b/include/repo.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include #include "../vendor/libgit2/include/git2.h" @@ -17,7 +16,7 @@ Copyright (c) 2011, Tim Branyen @tbranyen using namespace node; using namespace v8; -class GitRepo : public EventEmitter { +class GitRepo : public ObjectWrap { public: static Persistent constructor_template; static void Initialize(Handle target); @@ -43,7 +42,7 @@ class GitRepo : public EventEmitter { static Handle New(const Arguments& args); static Handle Open(const Arguments& args); - static int EIO_Open(eio_req* req); + static void EIO_Open(eio_req* req); static int EIO_AfterOpen(eio_req* req); static Handle Lookup(const Arguments& args); @@ -53,7 +52,7 @@ class GitRepo : public EventEmitter { static Handle Free(const Arguments& args); static Handle Init(const Arguments& args); - static int EIO_Init(eio_req* req); + static void EIO_Init(eio_req* req); static int EIO_AfterInit(eio_req* req); private: diff --git a/include/revwalk.h b/include/revwalk.h index 0a86ae222..2e1db881e 100755 --- a/include/revwalk.h +++ b/include/revwalk.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -17,7 +16,7 @@ Copyright (c) 2011, Tim Branyen @tbranyen using namespace node; using namespace v8; -class GitRevWalk : public EventEmitter { +class GitRevWalk : public ObjectWrap { public: static Persistent constructor_template; static void Initialize(Handle target); @@ -42,7 +41,7 @@ class GitRevWalk : public EventEmitter { static Handle Hide(const Arguments& args); static Handle Next(const Arguments& args); - static int EIO_Next(eio_req* req); + static void EIO_Next(eio_req* req); static int EIO_AfterNext(eio_req* req); static Handle Sorting(const Arguments& args); diff --git a/include/sig.h b/include/sig.h index 2f275b47f..c01778e20 100755 --- a/include/sig.h +++ b/include/sig.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -16,7 +15,7 @@ Copyright (c) 2011, Tim Branyen @tbranyen using namespace v8; using namespace node; -class GitSig : public EventEmitter { +class GitSig : public ObjectWrap { public: static Persistent constructor_template; static void Initialize(Handle target); diff --git a/include/tag.h b/include/tag.h index 6a941eedb..db8560d44 100755 --- a/include/tag.h +++ b/include/tag.h @@ -7,7 +7,6 @@ #define TAG_H #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/include/tree.h b/include/tree.h index 696d46351..74c748aab 100755 --- a/include/tree.h +++ b/include/tree.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include #include "../vendor/libgit2/include/git2.h" @@ -21,7 +20,7 @@ using namespace node; /** * Class wrapper for libgit2 git_tree */ -class GitTree : public EventEmitter { +class GitTree : public ObjectWrap { public: /** * v8::FunctionTemplate used to create Node.js constructor @@ -98,10 +97,10 @@ class GitTree : public EventEmitter { static int EIO_AfterLookup(eio_req *req); static Handle EntryCount(const Arguments& args); static Handle EntryByIndex(const Arguments& args); - static int EIO_EntryByIndex(eio_req *req); + static void EIO_EntryByIndex(eio_req *req); static int EIO_AfterEntryByIndex(eio_req *req); static Handle EntryByName(const Arguments& args); - static int EIO_EntryByName(eio_req *req); + static void EIO_EntryByName(eio_req *req); static int EIO_AfterEntryByName(eio_req *req); static Handle SortEntries(const Arguments& args); static Handle ClearEntries(const Arguments& args); diff --git a/include/tree_entry.h b/include/tree_entry.h index cc871ad7b..2d3634695 100755 --- a/include/tree_entry.h +++ b/include/tree_entry.h @@ -7,7 +7,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -22,7 +21,7 @@ using namespace node; /** * Class wrapper for libgit2 git_tree_entry */ -class GitTreeEntry : EventEmitter { +class GitTreeEntry : ObjectWrap { public: /** * v8::FunctionTemplate used to create Node.js constructor diff --git a/src/base.cc b/src/base.cc index 26b5d2d64..a74f08273 100755 --- a/src/base.cc +++ b/src/base.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/src/blob.cc b/src/blob.cc index 4b58f173f..3ef5668a8 100755 --- a/src/blob.cc +++ b/src/blob.cc @@ -111,13 +111,12 @@ Handle GitBlob::Lookup(const Arguments& args) { return scope.Close( Undefined() ); } -int GitBlob::EIO_Lookup(eio_req* req) { +void GitBlob::EIO_Lookup(eio_req* req) { lookup_request* ar = static_cast(req->data); git_oid oid = ar->oid->GetValue(); ar->err = ar->blob->Lookup(ar->repo->GetValue(), &oid); - return 0; } int GitBlob::EIO_AfterLookup(eio_req* req) { diff --git a/src/commit.cc b/src/commit.cc index eb552aed2..d85a9b727 100755 --- a/src/commit.cc +++ b/src/commit.cc @@ -6,7 +6,6 @@ #include #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -147,13 +146,12 @@ Handle GitCommit::Lookup(const Arguments& args) { return scope.Close( Undefined() ); } -int GitCommit::EIO_Lookup(eio_req *req) { +void GitCommit::EIO_Lookup(eio_req *req) { lookup_request *ar = static_cast(req->data); git_oid oid = ar->oid->GetValue(); ar->err = ar->commit->Lookup(ar->repo->GetValue(), &oid); - return 0; } int GitCommit::EIO_AfterLookup(eio_req *req) { diff --git a/src/error.cc b/src/error.cc index 011beb22d..9f180f667 100755 --- a/src/error.cc +++ b/src/error.cc @@ -5,7 +5,6 @@ #include #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/src/object.cc b/src/object.cc index a0b43d54f..9a15102ec 100755 --- a/src/object.cc +++ b/src/object.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/src/oid.cc b/src/oid.cc index d2973571a..a7bf5481b 100755 --- a/src/oid.cc +++ b/src/oid.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/src/reference.cc b/src/reference.cc index ab37f871f..5a9f8e29b 100755 --- a/src/reference.cc +++ b/src/reference.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include #include "../vendor/libgit2/include/git2.h" @@ -94,14 +93,13 @@ Handle GitReference::Lookup(const Arguments& args) { return scope.Close( Undefined() ); } -int GitReference::EIO_Lookup(eio_req *req) { +void GitReference::EIO_Lookup(eio_req *req) { lookup_request *ar = static_cast(req->data); git_repository* repo = ar->repo->GetValue(); ar->err = ar->ref->Lookup(repo, ar->name.c_str()); - return 0; } int GitReference::EIO_AfterLookup(eio_req *req) { diff --git a/src/repo.cc b/src/repo.cc index d288ef612..f44d41236 100755 --- a/src/repo.cc +++ b/src/repo.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include #include "../vendor/libgit2/include/git2.h" @@ -101,12 +100,11 @@ Handle GitRepo::Open(const Arguments& args) { return scope.Close( Undefined() ); } -int GitRepo::EIO_Open(eio_req *req) { +void GitRepo::EIO_Open(eio_req *req) { open_request *ar = static_cast(req->data); ar->err = ar->repo->Open(ar->path.c_str()); - return 0; } int GitRepo::EIO_AfterOpen(eio_req *req) { @@ -258,12 +256,11 @@ Handle GitRepo::Init(const Arguments& args) { return scope.Close( Undefined() ); } -int GitRepo::EIO_Init(eio_req *req) { +void GitRepo::EIO_Init(eio_req *req) { init_request *ar = static_cast(req->data); ar->err = ar->repo->Init(ar->path.c_str(), ar->is_bare); - return 0; } int GitRepo::EIO_AfterInit(eio_req *req) { diff --git a/src/revwalk.cc b/src/revwalk.cc index 3cc8f4738..3715a601d 100755 --- a/src/revwalk.cc +++ b/src/revwalk.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -156,14 +155,13 @@ Handle GitRevWalk::Next(const Arguments& args) { return scope.Close( Undefined() ); } -int GitRevWalk::EIO_Next(eio_req *req) { +void GitRevWalk::EIO_Next(eio_req *req) { next_request *ar = static_cast(req->data); git_oid oid = ar->oid->GetValue(); ar->err = ar->revwalk->Next(&oid); ar->oid->SetValue(oid); - return 0; } int GitRevWalk::EIO_AfterNext(eio_req *req) { diff --git a/src/sig.cc b/src/sig.cc index aafd5b76f..0b33e1089 100755 --- a/src/sig.cc +++ b/src/sig.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" diff --git a/src/tree.cc b/src/tree.cc index be1047173..fe3b1bdbf 100755 --- a/src/tree.cc +++ b/src/tree.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" @@ -190,12 +189,11 @@ Handle GitTree::EntryByIndex(const Arguments& args) { return scope.Close( Undefined() ); } -int GitTree::EIO_EntryByIndex(eio_req *req) { +void GitTree::EIO_EntryByIndex(eio_req *req) { entryindex_request *er = static_cast(req->data); er->entry->SetValue(er->tree->EntryByIndex(er->idx)); - return 0; } int GitTree::EIO_AfterEntryByIndex(eio_req *req) { @@ -256,12 +254,11 @@ Handle GitTree::EntryByName(const Arguments& args) { return scope.Close( Undefined() ); } -int GitTree::EIO_EntryByName(eio_req *req) { +void GitTree::EIO_EntryByName(eio_req *req) { entryname_request *er = static_cast(req->data); er->entry->SetValue(er->tree->EntryByName(er->name.c_str())); - return 0; } int GitTree::EIO_AfterEntryByName(eio_req *req) { diff --git a/src/tree_entry.cc b/src/tree_entry.cc index eda8937c2..088ae8b82 100755 --- a/src/tree_entry.cc +++ b/src/tree_entry.cc @@ -4,7 +4,6 @@ Copyright (c) 2011, Tim Branyen @tbranyen #include #include -#include #include "../vendor/libgit2/include/git2.h" From aa5a9ecba3de0ab1474af8c06a33b026badaca20 Mon Sep 17 00:00:00 2001 From: Morgan O'Neal Date: Fri, 9 Dec 2011 14:30:58 -0800 Subject: [PATCH 2/2] Changing build path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c73fac7f..461c0a9a8 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ install: @@mkdir -p $(INSTALL_PATH)/lib @@mkdir -p $(INSTALL_PATH)/vendor - @@cp -f $(BASE)/build/default/nodegit.node $(INSTALL_PATH)/build/default/nodegit.node + @@cp -f $(BASE)/build/Release/nodegit.node $(INSTALL_PATH)/build/default/nodegit.node @@cp -f $(BASE)/lib/* $(INSTALL_PATH)/lib/ @@cp -rf $(BASE)/vendor/* $(INSTALL_PATH)/vendor/ @@cp -f $(BASE)/package.json $(INSTALL_PATH)/