| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + - replace all argv crap with Wrap static methods for tighter instantiation | ||
| 2 | + - audit memory issues - explicit malloc and frees, copies | ||
| 3 | + - look into the v88 conversions crap | ||
| 4 | + - rename all async methods getXXX | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,9 +9,11 @@ | |||
| 9 | 9 | 'src/error.cc', | |
| 10 | 10 | 'src/oid.cc', | |
| 11 | 11 | 'src/reference.cc', | |
| 12 | + 'src/object.cc', | ||
| 12 | 13 | 'src/repo.cc', | |
| 13 | 14 | 'src/revwalk.cc', | |
| 14 | 15 | 'src/signature.cc', | |
| 16 | + 'src/time.cc', | ||
| 15 | 17 | 'src/tree.cc', | |
| 16 | 18 | 'src/tree_entry.cc', | |
| 17 | 19 | 'src/diff_list.cc', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ var idefs = JSON.parse(fs.readFileSync('v0.18.0.json')), | |||
| 8 | 8 | ||
| 9 | 9 | for (var i in idefs) { | |
| 10 | 10 | var idef = idefs[i]; | |
| 11 | - if (["Oid", "Blob", "Repo", "Reference"].indexOf(idef.jsClassName) > -1) { | ||
| 11 | + if (["Oid", "Blob", "Repo", "Reference", "Object", "TreeEntry", "Commit", "Signature", "Time"].indexOf(idef.jsClassName) > -1) { | ||
| 12 | 12 | fs.writeFileSync( | |
| 13 | 13 | path.resolve("./include/" + idef.filename), headerTemplate(idef)); | |
| 14 | 14 | fs.writeFileSync( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ class GitBlob : public ObjectWrap { | |||
| 28 | 28 | ||
| 29 | 29 | static Handle<Value> New(const Arguments& args); | |
| 30 | 30 | ||
| 31 | + | ||
| 31 | 32 | static Handle<Value> Lookup(const Arguments& args); | |
| 32 | 33 | static void LookupWork(uv_work_t* req); | |
| 33 | 34 | static void LookupAfterWork(uv_work_t* req); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,162 +1,79 @@ | |||
| 1 | - /* | ||
| 2 | - * Copyright 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com> | ||
| 3 | - * @author Michael Robinson @codeofinterest <mike@pagesofinterest.net> | ||
| 4 | - * | ||
| 5 | - * Dual licensed under the MIT and GPL licenses. | ||
| 6 | - */ | ||
| 1 | + /** | ||
| 2 | + * This code is auto-generated; unless you know what you're doing, do not modify! | ||
| 3 | + **/ | ||
| 4 | + | ||
| 5 | + #ifndef GITCOMMIT_H | ||
| 6 | + #define GITCOMMIT_H | ||
| 7 | 7 | ||
| 8 | 8 | #include <v8.h> | |
| 9 | 9 | #include <node.h> | |
| 10 | - #include <vector> | ||
| 10 | + #include <string> | ||
| 11 | 11 | ||
| 12 | 12 | #include "git2.h" | |
| 13 | 13 | ||
| 14 | - #include "reference.h" | ||
| 15 | - #include "repo.h" | ||
| 16 | - #include "oid.h" | ||
| 17 | - #include "tree.h" | ||
| 18 | - | ||
| 19 | 14 | using namespace node; | |
| 20 | 15 | using namespace v8; | |
| 21 | 16 | ||
| 22 | - /** | ||
| 23 | - * Class wrapper for libgit2 git_commit | ||
| 24 | - */ | ||
| 25 | 17 | class GitCommit : public ObjectWrap { | |
| 26 | 18 | public: | |
| 27 | - /** | ||
| 28 | - * v8::FunctionTemplate used to create Node.js constructor | ||
| 29 | - */ | ||
| 30 | - static Persistent<Function> constructor_template; | ||
| 31 | 19 | ||
| 32 | - /** | ||
| 33 | - * Used to intialize the EventEmitter from Node.js | ||
| 34 | - * | ||
| 35 | - * @param target v8::Object the Node.js module object | ||
| 36 | - */ | ||
| 20 | + static Persistent<Function> constructor_template; | ||
| 37 | 21 | static void Initialize (Handle<v8::Object> target); | |
| 38 | 22 | ||
| 39 | - git_commit* GetValue(); | ||
| 40 | - void SetValue(git_commit* commit); | ||
| 41 | - void SetOid(git_oid* oid); | ||
| 23 | + git_commit *GetValue(); | ||
| 42 | 24 | ||
| 43 | - protected: | ||
| 44 | - GitCommit() {} | ||
| 45 | - ~GitCommit() {} | ||
| 25 | + private: | ||
| 26 | + GitCommit(git_commit *raw); | ||
| 27 | + ~GitCommit(); | ||
| 46 | 28 | ||
| 47 | 29 | static Handle<Value> New(const Arguments& args); | |
| 48 | - static Handle<Value> Free(const Arguments& args); | ||
| 30 | + | ||
| 49 | 31 | ||
| 50 | 32 | static Handle<Value> Lookup(const Arguments& args); | |
| 51 | - static void LookupWork(uv_work_t *req); | ||
| 52 | - static void LookupAfterWork(uv_work_t *req); | ||
| 33 | + static void LookupWork(uv_work_t* req); | ||
| 34 | + static void LookupAfterWork(uv_work_t* req); | ||
| 53 | 35 | ||
| 36 | + struct LookupBaton { | ||
| 37 | + uv_work_t request; | ||
| 38 | + const git_error* error; | ||
| 39 | + git_commit * commit; | ||
| 40 | + git_repository * repo; | ||
| 41 | + const git_oid * id; | ||
| 42 | + Persistent<Function> callback; | ||
| 43 | + }; | ||
| 54 | 44 | static Handle<Value> Oid(const Arguments& args); | |
| 55 | - | ||
| 45 | + static Handle<Value> MessageEncoding(const Arguments& args); | ||
| 56 | 46 | static Handle<Value> Message(const Arguments& args); | |
| 57 | - static void MessageWork(uv_work_t* req); | ||
| 58 | - static void MessageAfterWork(uv_work_t* req); | ||
| 59 | - | ||
| 60 | 47 | static Handle<Value> Time(const Arguments& args); | |
| 61 | - static void TimeWork(uv_work_t* req); | ||
| 62 | - static void TimeAfterWork(uv_work_t* req); | ||
| 63 | - | ||
| 64 | 48 | static Handle<Value> Offset(const Arguments& args); | |
| 65 | - static void OffsetWork(uv_work_t* req); | ||
| 66 | - static void OffsetAfterWork(uv_work_t* req); | ||
| 67 | - | ||
| 68 | - static Handle<Value> Author(const Arguments& args); | ||
| 69 | - static void AuthorWork(uv_work_t* req); | ||
| 70 | - static void AuthorAfterWork(uv_work_t* req); | ||
| 71 | - | ||
| 72 | 49 | static Handle<Value> Committer(const Arguments& args); | |
| 73 | - static void CommitterWork(uv_work_t* req); | ||
| 74 | - static void CommitterAfterWork(uv_work_t* req); | ||
| 75 | - | ||
| 50 | + static Handle<Value> Author(const Arguments& args); | ||
| 76 | 51 | static Handle<Value> Tree(const Arguments& args); | |
| 77 | 52 | static void TreeWork(uv_work_t* req); | |
| 78 | 53 | static void TreeAfterWork(uv_work_t* req); | |
| 79 | 54 | ||
| 80 | - static Handle<Value> Parents(const Arguments& args); | ||
| 81 | - static void ParentsWork(uv_work_t* req); | ||
| 82 | - static void ParentsAfterWork(uv_work_t* req); | ||
| 83 | - | ||
| 84 | - private: | ||
| 85 | - git_commit* commit; | ||
| 86 | - git_oid* oid; | ||
| 87 | - | ||
| 88 | - struct LookupBaton { | ||
| 89 | - uv_work_t request; | ||
| 90 | - const git_error* error; | ||
| 91 | - | ||
| 92 | - git_repository* repo; | ||
| 93 | - git_oid rawOid; | ||
| 94 | - std::string sha; | ||
| 95 | - git_commit* rawCommit; | ||
| 96 | - | ||
| 97 | - Persistent<Function> callback; | ||
| 98 | - }; | ||
| 99 | - | ||
| 100 | - struct MessageBaton { | ||
| 101 | - uv_work_t request; | ||
| 102 | - | ||
| 103 | - git_commit* rawCommit; | ||
| 104 | - std::string message; | ||
| 105 | - | ||
| 106 | - Persistent<Function> callback; | ||
| 107 | - }; | ||
| 108 | - | ||
| 109 | - struct TimeBaton { | ||
| 110 | - uv_work_t request; | ||
| 111 | - | ||
| 112 | - git_commit* rawCommit; | ||
| 113 | - git_time_t time; | ||
| 114 | - | ||
| 115 | - Persistent<Function> callback; | ||
| 116 | - }; | ||
| 117 | - | ||
| 118 | - struct SignatureBaton { | ||
| 119 | - uv_work_t request; | ||
| 120 | - | ||
| 121 | - git_commit* rawCommit; | ||
| 122 | - const git_signature* rawSignature; | ||
| 123 | - | ||
| 124 | - Persistent<Function> callback; | ||
| 125 | - }; | ||
| 126 | - | ||
| 127 | - struct OffsetBaton { | ||
| 128 | - uv_work_t request; | ||
| 129 | - | ||
| 130 | - git_commit* rawCommit; | ||
| 131 | - int offset; | ||
| 132 | - | ||
| 133 | - Persistent<Function> callback; | ||
| 134 | - }; | ||
| 135 | - | ||
| 136 | - | ||
| 137 | 55 | struct TreeBaton { | |
| 138 | 56 | uv_work_t request; | |
| 139 | 57 | const git_error* error; | |
| 140 | - | ||
| 141 | - git_commit* rawCommit; | ||
| 142 | - git_tree* rawTree; | ||
| 143 | - | ||
| 58 | + git_tree * tree_out; | ||
| 59 | + const git_commit * commit; | ||
| 144 | 60 | Persistent<Function> callback; | |
| 145 | 61 | }; | |
| 62 | + static Handle<Value> TreeId(const Arguments& args); | ||
| 63 | + static Handle<Value> ParentCount(const Arguments& args); | ||
| 64 | + static Handle<Value> Parent(const Arguments& args); | ||
| 65 | + static void ParentWork(uv_work_t* req); | ||
| 66 | + static void ParentAfterWork(uv_work_t* req); | ||
| 146 | 67 | ||
| 147 | - struct Parent { | ||
| 148 | - const git_oid* rawOid; | ||
| 149 | - git_commit* rawCommit; | ||
| 150 | - }; | ||
| 151 | - | ||
| 152 | - struct ParentsBaton { | ||
| 68 | + struct ParentBaton { | ||
| 153 | 69 | uv_work_t request; | |
| 154 | 70 | const git_error* error; | |
| 155 | - | ||
| 156 | - int index; | ||
| 157 | - git_commit* rawCommit; | ||
| 158 | - std::vector<Parent* > parents; | ||
| 159 | - | ||
| 71 | + git_commit * out; | ||
| 72 | + git_commit * commit; | ||
| 73 | + unsigned int n; | ||
| 160 | 74 | Persistent<Function> callback; | |
| 161 | 75 | }; | |
| 76 | + git_commit *raw; | ||
| 162 | 77 | }; | |
| 78 | + | ||
| 79 | + #endif | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,14 +32,12 @@ class GitDiffList : public ObjectWrap { | |||
| 32 | 32 | static void Initialize (Handle<v8::Object> target); | |
| 33 | 33 | ||
| 34 | 34 | git_diff_list* GetValue(); | |
| 35 | - void SetValue(git_diff_list* diffList); | ||
| 36 | 35 | ||
| 37 | 36 | protected: | |
| 38 | - GitDiffList() {} | ||
| 39 | - ~GitDiffList() {} | ||
| 37 | + GitDiffList(git_diff_list *raw); | ||
| 38 | + ~GitDiffList(); | ||
| 40 | 39 | ||
| 41 | 40 | static Handle<Value> New(const Arguments& args); | |
| 42 | - static Handle<Value> Free(const Arguments& args); | ||
| 43 | 41 | ||
| 44 | 42 | static Handle<Value> TreeToTree(const Arguments& args); | |
| 45 | 43 | static void TreeToTreeWork(uv_work_t *req); | |
@@ -72,7 +70,7 @@ class GitDiffList : public ObjectWrap { | |||
| 72 | 70 | static void WalkWorkSendEnd(uv_async_t *handle, int status /*UNUSED*/); | |
| 73 | 71 | ||
| 74 | 72 | private: | |
| 75 | - git_diff_list* diffList; | ||
| 73 | + git_diff_list* raw; | ||
| 76 | 74 | ||
| 77 | 75 | struct TreeToTreeBaton { | |
| 78 | 76 | uv_work_t request; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,62 @@ | |||
| 1 | + /** | ||
| 2 | + * This code is auto-generated; unless you know what you're doing, do not modify! | ||
| 3 | + **/ | ||
| 4 | + | ||
| 5 | + #ifndef GITOBJECT_H | ||
| 6 | + #define GITOBJECT_H | ||
| 7 | + | ||
| 8 | + #include <v8.h> | ||
| 9 | + #include <node.h> | ||
| 10 | + #include <string> | ||
| 11 | + | ||
| 12 | + #include "git2.h" | ||
| 13 | + | ||
| 14 | + using namespace node; | ||
| 15 | + using namespace v8; | ||
| 16 | + | ||
| 17 | + class GitObject : public ObjectWrap { | ||
| 18 | + public: | ||
| 19 | + | ||
| 20 | + static Persistent<Function> constructor_template; | ||
| 21 | + static void Initialize (Handle<v8::Object> target); | ||
| 22 | + | ||
| 23 | + git_object *GetValue(); | ||
| 24 | + | ||
| 25 | + private: | ||
| 26 | + GitObject(git_object *raw); | ||
| 27 | + ~GitObject(); | ||
| 28 | + | ||
| 29 | + static Handle<Value> New(const Arguments& args); | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + static Handle<Value> Lookup(const Arguments& args); | ||
| 33 | + static void LookupWork(uv_work_t* req); | ||
| 34 | + static void LookupAfterWork(uv_work_t* req); | ||
| 35 | + | ||
| 36 | + struct LookupBaton { | ||
| 37 | + uv_work_t request; | ||
| 38 | + const git_error* error; | ||
| 39 | + git_object * object; | ||
| 40 | + git_repository * repo; | ||
| 41 | + const git_oid * id; | ||
| 42 | + git_otype type; | ||
| 43 | + Persistent<Function> callback; | ||
| 44 | + }; | ||
| 45 | + static Handle<Value> Oid(const Arguments& args); | ||
| 46 | + static Handle<Value> Type(const Arguments& args); | ||
| 47 | + static Handle<Value> Peel(const Arguments& args); | ||
| 48 | + static void PeelWork(uv_work_t* req); | ||
| 49 | + static void PeelAfterWork(uv_work_t* req); | ||
| 50 | + | ||
| 51 | + struct PeelBaton { | ||
| 52 | + uv_work_t request; | ||
| 53 | + const git_error* error; | ||
| 54 | + git_object * peeled; | ||
| 55 | + const git_object * object; | ||
| 56 | + git_otype target_type; | ||
| 57 | + Persistent<Function> callback; | ||
| 58 | + }; | ||
| 59 | + git_object *raw; | ||
| 60 | + }; | ||
| 61 | + | ||
| 62 | + #endif | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ class GitOid : public ObjectWrap { | |||
| 28 | 28 | ||
| 29 | 29 | static Handle<Value> New(const Arguments& args); | |
| 30 | 30 | ||
| 31 | + | ||
| 31 | 32 | static Handle<Value> FromString(const Arguments& args); | |
| 32 | 33 | static Handle<Value> Sha(const Arguments& args); | |
| 33 | 34 | git_oid *raw; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ class GitReference : public ObjectWrap { | |||
| 28 | 28 | ||
| 29 | 29 | static Handle<Value> New(const Arguments& args); | |
| 30 | 30 | ||
| 31 | + | ||
| 31 | 32 | static Handle<Value> Lookup(const Arguments& args); | |
| 32 | 33 | static void LookupWork(uv_work_t* req); | |
| 33 | 34 | static void LookupAfterWork(uv_work_t* req); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ class GitRepo : public ObjectWrap { | |||
| 28 | 28 | ||
| 29 | 29 | static Handle<Value> New(const Arguments& args); | |
| 30 | 30 | ||
| 31 | + | ||
| 31 | 32 | static Handle<Value> Open(const Arguments& args); | |
| 32 | 33 | static void OpenWork(uv_work_t* req); | |
| 33 | 34 | static void OpenAfterWork(uv_work_t* req); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments