From fdcad7f0678025ce67fa2a7bc2d6705951869ad2 Mon Sep 17 00:00:00 2001 From: Maximiliano Korp Date: Thu, 15 Sep 2016 11:12:25 -0700 Subject: [PATCH 01/53] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f216cae0..30c2158fb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.15.1", + "version": "0.16.0", "homepage": "http://nodegit.org", "keywords": [ "libgit2", From f61f52e76a595fd6e48a660177a17feac069a219 Mon Sep 17 00:00:00 2001 From: Daniel Axelrod Date: Wed, 21 Oct 2015 18:13:46 -0400 Subject: [PATCH 02/53] Define GIT_SSH_MEMORY_CREDENTIALS for libgit2 Compile libgit2 with GIT_SSH_MEMORY_CREDENTIALS defined to allow sshKeyMemoryNew to work. Fixes #760 --- test/tests/cred.js | 18 ++++++++++++++++++ vendor/libgit2.gyp | 1 + 2 files changed, 19 insertions(+) diff --git a/test/tests/cred.js b/test/tests/cred.js index 7500dc303..6f0bb46ad 100644 --- a/test/tests/cred.js +++ b/test/tests/cred.js @@ -1,5 +1,6 @@ var assert = require("assert"); var path = require("path"); +var fs = require("fs"); var local = path.join.bind(path, __dirname); describe("Cred", function() { @@ -23,6 +24,23 @@ describe("Cred", function() { assert.ok(cred instanceof NodeGit.Cred); }); + it("can create ssh credentials using passed keys in memory", function() { + var publicKeyContents = fs.readFileSync(sshPublicKey, { + encoding: "ascii" + }); + var privateKeyContents = fs.readFileSync(sshPrivateKey, { + encoding: "ascii" + }); + + return NodeGit.Cred.sshKeyMemoryNew( + "username", + publicKeyContents, + privateKeyContents, + "").then(function(cred) { + assert.ok(cred instanceof NodeGit.Cred); + }); + }); + it("can create credentials using plaintext", function() { var plaintextCreds = NodeGit.Cred.userpassPlaintextNew ("username", "password"); diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index e763d6814..06530bdaa 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -16,6 +16,7 @@ "defines": [ "GIT_THREADS", "GIT_SSH", + "GIT_SSH_MEMORY_CREDENTIALS", # Node's util.h may be accidentally included so use this to guard # against compilation error. "SRC_UTIL_H_", From 2a2ef76b6833a3672480b216fd574af390af4c01 Mon Sep 17 00:00:00 2001 From: kokarn Date: Fri, 23 Sep 2016 11:34:04 +0200 Subject: [PATCH 03/53] Add "Path" to variable names for clarity --- test/tests/clone.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/tests/clone.js b/test/tests/clone.js index 40c557dee..c7645357d 100644 --- a/test/tests/clone.js +++ b/test/tests/clone.js @@ -12,10 +12,10 @@ describe("Clone", function() { var clonePath = local("../repos/clone"); - var sshPublicKey = local("../id_rsa.pub"); - var sshPrivateKey = local("../id_rsa"); - var sshEncryptedPublicKey = local("../encrypted_rsa.pub"); - var sshEncryptedPrivateKey = local("../encrypted_rsa"); + var sshPublicKeyPath = local("../id_rsa.pub"); + var sshPrivateKeyPath = local("../id_rsa"); + var sshEncryptedPublicKeyPath = local("../encrypted_rsa.pub"); + var sshEncryptedPrivateKeyPath = local("../encrypted_rsa"); // Set a reasonable timeout here now that our repository has grown. this.timeout(30000); @@ -219,8 +219,8 @@ describe("Clone", function() { credentials: function(url, userName) { return NodeGit.Cred.sshKeyNew( userName, - sshPublicKey, - sshPrivateKey, + sshPublicKeyPath, + sshPrivateKeyPath, ""); } } @@ -245,8 +245,8 @@ describe("Clone", function() { credentials: function(url, userName) { return NodeGit.Cred.sshKeyNew( userName, - sshEncryptedPublicKey, - sshEncryptedPrivateKey, + sshEncryptedPublicKeyPath, + sshEncryptedPrivateKeyPath, "test-password" ); } From 2c94641ef039deef4fbd04795cae7d4a1563efbc Mon Sep 17 00:00:00 2001 From: Max Korp Date: Mon, 26 Sep 2016 16:00:16 -0700 Subject: [PATCH 04/53] Change readme link from gitter to slack --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6b0338f8..c4adec119 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ NodeGit ## Have a problem? Come chat with us! ## -[![Gitter](http://www.nodegit.org/img/gitterbadge.svg)](https://gitter.im/nodegit/nodegit) +https://libgit2.slack.com/ ## Maintained by ## Tim Branyen [@tbranyen](http://twitter.com/tbranyen), From f0ba2e1bd07e2bd91236eeff08e30da2ebe9f96f Mon Sep 17 00:00:00 2001 From: Diogo Franco Date: Wed, 28 Sep 2016 21:17:10 +0900 Subject: [PATCH 05/53] Fix typo --- lifecycleScripts/postinstall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lifecycleScripts/postinstall.js b/lifecycleScripts/postinstall.js index 91e7c2a3c..bdf8a7279 100755 --- a/lifecycleScripts/postinstall.js +++ b/lifecycleScripts/postinstall.js @@ -71,7 +71,7 @@ if (require.main === module) { console.warn("[nodegit] WARN - Could not finish postinstall"); if ( - process.pladtform === "linux" && + process.platform === "linux" && ~e.toString().indexOf("libstdc++") ) { printStandardLibError(); From 8d69ff23204ac36b324ffa672be99f6996bdceaa Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Wed, 5 Oct 2016 14:42:53 -0700 Subject: [PATCH 06/53] Ignore npm install failure only for 0.12 Revert "Use npm 2.15.11 with node 0.12" This reverts commit 9503b5cc6b5b9a665f6d07d4090327a4d5e09cae. Revert "Log npm-debug.log after failure" This reverts commit 412ce63c5e79cc457c5010123e4ac430bb9f7ea9. Remove ls attempt Ls purported npm-debug.log location and ignore npm install failure Attempt to cat npm-debug.log after install failure Log npm-debug.log after failure Use npm 2.15.11 with node 0.12 --- .travis.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d65107654..d17cd1fa9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,8 +77,19 @@ before_install: export JOBS=4; fi +# node 0.12 is sometimes failing +# with a "Callback called more than once" error +# Despite that error, it seems like modules do get installed correctly, +# and the rest of the build proceeds as normal. +# So we ignore that error, just for node 0.12 +# If npm install ever fails in a more significant way, +# the rest of the build should hopefully fail anyway. install: - - npm install + - if [[ $NODE_VERSION == "0.12" ]]; then + npm install || true; + else + npm install; + fi # This is a random private key used purely for testing. before_script: From 1318e7eae1202dc8ebc22754fc970f2c020fff0c Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Fri, 23 Sep 2016 17:44:45 -0700 Subject: [PATCH 07/53] Fix application of /EHsc option --- generate/templates/templates/binding.gyp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index ccf254965..2d2ded59a 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -72,12 +72,16 @@ ], [ "OS=='win'", { - "cflags": [ - "/EHsc" - ], "defines": [ "_HAS_EXCEPTIONS=1" ], + "msvs_settings": { + "VCCLCompilerTool": { + "AdditionalOptions": [ + "/EHsc" + ] + } + }, "configurations": { "Debug": { "msvs_settings": { From e3d58995c05a89af0e701daaba07ee167ba5130a Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Fri, 23 Sep 2016 18:00:07 -0700 Subject: [PATCH 08/53] Pull in identical settings to shared section --- generate/templates/templates/binding.gyp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index 2d2ded59a..457221dcd 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -80,26 +80,11 @@ "AdditionalOptions": [ "/EHsc" ] - } - }, - "configurations": { - "Debug": { - "msvs_settings": { - "VCLinkerTool": { - "AdditionalOptions": [ - "/FORCE:MULTIPLE" - ] - } - } }, - "Release": { - "msvs_settings": { - "VCLinkerTool": { - "AdditionalOptions": [ - "/FORCE:MULTIPLE" - ] - } - } + "VCLinkerTool": { + "AdditionalOptions": [ + "/FORCE:MULTIPLE" + ] } } } From 55aacdb89100e6edf71fe8d1e16820fd74a055a6 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Fri, 23 Sep 2016 09:25:01 -0700 Subject: [PATCH 09/53] Mark revwalk as selfFreeing --- generate/input/descriptor.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index a116184ef..0df5ca52d 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -2100,6 +2100,7 @@ "ignore": true }, "revwalk": { + "selfFreeing": true, "dependencies": [ "../include/commit.h", "../include/functions/copy.h" @@ -2108,9 +2109,6 @@ "git_revwalk_add_hide_cb": { "ignore": true }, - "git_revwalk_free": { - "ignore": true - }, "git_revwalk_new": { "isAsync": false } From 80937a353b7ca66bbc213e1c52cca2c0fa22ac7a Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Wed, 7 Sep 2016 10:27:39 -0700 Subject: [PATCH 10/53] Mark tree entry as selfFreeing --- generate/input/descriptor.json | 11 +++++++++-- generate/scripts/helpers.js | 7 +------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index a116184ef..29b5b65cc 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -2499,10 +2499,16 @@ } }, "git_tree_entry_byindex": { - "jsFunctionName": "_entryByIndex" + "jsFunctionName": "_entryByIndex", + "return": { + "ownedByThis": true + } }, "git_tree_entry_byname": { - "jsFunctionName": "_entryByName" + "jsFunctionName": "_entryByName", + "return": { + "ownedByThis": true + } }, "git_tree_entrycount": { "jsFunctionName": "entryCount" @@ -2539,6 +2545,7 @@ } }, "tree_entry": { + "selfFreeing": true, "dupFunction": "git_tree_entry_dup", "freeFunctionName": "git_tree_entry_free", "functions": { diff --git a/generate/scripts/helpers.js b/generate/scripts/helpers.js index bb4953e8e..f3bd3772f 100644 --- a/generate/scripts/helpers.js +++ b/generate/scripts/helpers.js @@ -251,7 +251,7 @@ var Helpers = { arg.cppClassName = Helpers.cTypeToCppName(arg.cType); arg.jsClassName = utils.titleCase(Helpers.cTypeToJsName(arg.cType)); - var libgitType = Helpers.decorateLibgitType(arg, libgit2.types, enums); + Helpers.decorateLibgitType(arg, libgit2.types, enums); // Some arguments can be callbacks if (Helpers.isCallbackFunction(type)) { @@ -280,11 +280,6 @@ var Helpers = { argOverrides.cppClassName !== "Array" && _.every(allArgs, function(_arg) { return !_arg.isSelf; }); } - - if (arg.isReturn && libgitType) { - arg.selfFreeing = libgitType.selfFreeing; - } - if (arg.isReturn && fnDef.return && fnDef.return.type === "int") { fnDef.return.isErrorCode = true; fnDef.isAsync = true; From 0a707b00a43d2d39109e37fae71b62a75245824f Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Fri, 23 Sep 2016 14:26:52 -0700 Subject: [PATCH 11/53] Add tree entry leak test --- test/tests/tree_entry.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/tests/tree_entry.js b/test/tests/tree_entry.js index 178bf1168..b4d0706c5 100644 --- a/test/tests/tree_entry.js +++ b/test/tests/tree_entry.js @@ -2,6 +2,8 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); +var leakTest = require("../utils/leak_test"); + describe("TreeEntry", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; @@ -153,4 +155,15 @@ describe("TreeEntry", function() { assert.equal(entry.isSubmodule(), false); }); }); + + it("does not leak", function() { + var test = this; + + return leakTest(NodeGit.TreeEntry, function() { + return test.commit.getTree() + .then(function(tree) { + return tree.entryByPath("example"); + }); + }); + }); }); From c9a0daf68f13a85c416e13a036fc8f5725625f08 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Fri, 23 Sep 2016 13:59:21 -0700 Subject: [PATCH 12/53] Add revwalk leak test --- test/tests/revwalk.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/tests/revwalk.js b/test/tests/revwalk.js index 96bb736c8..cc3942c37 100644 --- a/test/tests/revwalk.js +++ b/test/tests/revwalk.js @@ -5,6 +5,8 @@ var fse = promisify(require("fs-extra")); var path = require("path"); var local = path.join.bind(path, __dirname); +var leakTest = require("../utils/leak_test"); + describe("Revwalk", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; @@ -309,6 +311,14 @@ describe("Revwalk", function() { }); }); + it("does not leak", function() { + var test = this; + + return leakTest(NodeGit.Revwalk, function() { + return Promise.resolve(NodeGit.Revwalk.create(test.repository)); + }); + }); + // This test requires forcing garbage collection, so mocha needs to be run // via node rather than npm, with a la `node --expose-gc [pathtohmoca] // [testglob]` From 0c55932e56b1aa4a542ca10eb096e429d6442818 Mon Sep 17 00:00:00 2001 From: Jon Hall Date: Fri, 14 Oct 2016 15:18:33 +0100 Subject: [PATCH 13/53] Fix postinstall script crash when install location has spaces in its path --- lifecycleScripts/postinstall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lifecycleScripts/postinstall.js b/lifecycleScripts/postinstall.js index 91e7c2a3c..43d2199c8 100755 --- a/lifecycleScripts/postinstall.js +++ b/lifecycleScripts/postinstall.js @@ -30,7 +30,7 @@ module.exports = function install() { return Promise.resolve(); } - return exec("node " + path.join(rootPath, "dist/nodegit.js")) + return exec("node \"" + path.join(rootPath, "dist/nodegit.js\"")) .catch(function(e) { if (~e.toString().indexOf("Module version mismatch")) { console.warn( From 573d6b7ac870d67cfea77a0018350b09cc61168e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Cie=C5=9Blak?= Date: Sat, 15 Oct 2016 10:44:47 +0000 Subject: [PATCH 14/53] Update 0.13 changelog Fixes #1147 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e2e82f05..815a96c5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ We have added Node 6 as a supported platform! Going forward we aim to have 1:1 s - Made `ancestoryEntry`, `outEntry` and `theirEntry` optional parameters on `Index#conflictAdd` [PR #997](https://github.com/nodegit/nodegit/pull/997) - `Repository#refreshIndex` will return an Index object back that has the latest data loaded off of disk [PR #986](https://github.com/nodegit/nodegit/pull/986) - `Commit.create` is now asynchronous [PR #1022](https://github.com/nodegit/nodegit/pull/1022) +- `Remote.create` is now asynchronous [PR #990](https://github.com/nodegit/nodegit/pull/990) ### Added @@ -103,7 +104,7 @@ We have added Node 6 as a supported platform! Going forward we aim to have 1:1 s ### Removed -- `Repository#openIndex` [PR #990](https://github.com/nodegit/nodegit/pull/990) +- `Repository#openIndex` [PR #989](https://github.com/nodegit/nodegit/pull/989), use `Repository#index` or `Repository#refreshIndex` instead - `Reflog#entryCommitter`, `Reflog#entryIdNew`, `Reflog#entryIdOld`, and `Reflog#entryMessage` have been moved to be under `ReflogEntry` [PR #1013](https://github.com/nodegit/nodegit/pull/1013) From c7d012c53461e5e9d102f06f3f11c2fce8304093 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Thu, 24 Nov 2016 17:14:12 +0800 Subject: [PATCH 15/53] Minor documentation fix in Checkout.index --- lib/checkout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkout.js b/lib/checkout.js index 652f6116a..329e0c7f4 100644 --- a/lib/checkout.js +++ b/lib/checkout.js @@ -25,7 +25,7 @@ Checkout.head = function(url, options) { * * @async * @param {Repository} repo The repo to checkout an index -* @param {Index} The index to checkout +* @param {Index} index The index to checkout * @param {CheckoutOptions} [options] Options for the checkout * @return {Void} checkout complete */ From 5fdaa10aed5f9737ecbac36eda3f4f8deeff6f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Cie=C5=9Blak?= Date: Sat, 26 Nov 2016 20:09:12 +0000 Subject: [PATCH 16/53] FreeBSD also uses struct timespec st_mtim Fixes https://github.com/nodegit/nodegit/issues/1160 --- vendor/libgit2.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 06530bdaa..37c19fd72 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -277,7 +277,7 @@ } } }], - ["OS=='linux'", { + ["OS=='linux' or OS.endswith('bsd')" , { "cflags": [ "-DGIT_SSH", "-DGIT_SSL", From a5ca132f427ba86e2e955f8a9457c1d671cbd545 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Fri, 2 Dec 2016 06:59:40 +0900 Subject: [PATCH 17/53] Update readme with Slack information Provide the link to get the Slack invitation and the name of the channel to join. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4adec119..cc3d7f7b2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ NodeGit ## Have a problem? Come chat with us! ## -https://libgit2.slack.com/ +Visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up, then join us in #nodegit. ## Maintained by ## Tim Branyen [@tbranyen](http://twitter.com/tbranyen), From 34814aeb26e5092a7ef40cb0fcd585aa9b8f3677 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Tue, 3 Jan 2017 16:42:05 +0900 Subject: [PATCH 18/53] Add @async tag to getEntry The getEntry function is asynchronous so it should be tagged with @async so the documentation will be generated correctly. --- lib/tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tree.js b/lib/tree.js index 0ece24abc..1be687075 100644 --- a/lib/tree.js +++ b/lib/tree.js @@ -100,7 +100,7 @@ Tree.prototype.entryByName = function(name) { /** * Get an entry at a path. Unlike by name, this takes a fully * qualified path, like `/foo/bar/baz.javascript` - * + * @async * @param {String} filePath * @return {TreeEntry} */ From 385760aec78c3d6cb495c6d36d64df066aea1175 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Wed, 4 Jan 2017 06:03:15 +0900 Subject: [PATCH 19/53] Fix incorrect anchor link in TESTING.md Changed a link to point internally instead of unnecessarily using an external link. --- TESTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index 348bb8ed3..c149c6b5b 100644 --- a/TESTING.md +++ b/TESTING.md @@ -52,7 +52,7 @@ After you write your test make sure to run `npm run generateMissingTests` again ### The test passes ### -Excellent!! Make sure that the test is working correctly and testing what you're expecting it to test and then move onto the [next section](https://github.com/nodegit/nodegit/tree/master/test#making-a-pull-request). +Excellent!! Make sure that the test is working correctly and testing what you're expecting it to test and then move onto the [next section](#making-a-pull-request). ### The test fails ### From dcdc3ce7a3bb69ee0a63df001e98ba3e614b6920 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Thu, 5 Jan 2017 22:12:51 +0900 Subject: [PATCH 20/53] Added tests for Tag create annotationCreate --- test/tests/tag.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/test/tests/tag.js b/test/tests/tag.js index 77b411f45..11b4f566f 100644 --- a/test/tests/tag.js +++ b/test/tests/tag.js @@ -9,12 +9,14 @@ describe("Tag", function() { var Obj = NodeGit.Object; var Oid = NodeGit.Oid; var Reference = NodeGit.Reference; + var Signature = NodeGit.Signature; var reposPath = local("../repos/workdir"); var tagName = "annotated-tag"; var tagFullName = "refs/tags/" + tagName; var tagOid = "dc800017566123ff3c746b37284a24a66546667e"; var commitPointedTo = "32789a79e71fbc9e04d3eff7425e1771eb595150"; + var commitPointedTo2 = "c82fb078a192ea221c9f1093c64321c60d64aa0d"; var tagMessage = "This is an annotated tag\n"; function testTag(tag, name) { @@ -144,4 +146,78 @@ describe("Tag", function() { return Promise.resolve(); }); }); + + it("can create a new signed tag with Tag.create and delete it", function() { + var name = "created-signed-tag-create"; + var repository = this.repository; + var signature = Signature.default(repository); + var commit = null; + var commit2 = null; + + return repository.getCommit(commitPointedTo) + .then(function(theCommit) { + commit = theCommit; + return repository.getCommit(commitPointedTo2); + }) + .then(function(theCommit2) { + commit2 = theCommit2; + return Tag.create(repository, name, commit, signature, tagMessage, 1); + }) + .then(function(oid) { + return repository.getTag(oid); + }) + .then(function(tag) { + testTag(tag, name); + assert(tag.tagger(), signature); + }) + .then(function() { + // overwriting is okay + return Tag.create(repository, name, commit2, signature, tagMessage, 1); + }) + .then(function() { + // overwriting is not okay + return Tag.create(repository, name, commit, signature, tagMessage, 0); + }) + .then(function() { + return Promise.reject(new Error("should not be able to create the '" + + name + "' tag twice")); + }, function() { + return Promise.resolve() + .then(function() { + return repository.deleteTagByName(name); + }) + .then(function() { + return Reference.lookup(repository, "refs/tags/" + name); + }) + .then(function() { + return Promise.reject(new Error("the tag '" + name + + "' should not exist")); + }, function() { + return Promise.resolve(); + }); + }); + }); + + it("can create a new signed tag with Tag.annotationCreate", function() { + var oid = Oid.fromString(commitPointedTo); + var name = "created-signed-tag-annotationCreate"; + var repository = this.repository; + var signature = Signature.default(repository); + var odb = null; + + return repository.odb() + .then(function(theOdb) { + odb = theOdb; + }) + .then(function() { + return Tag.annotationCreate( + repository, name, oid, signature, tagMessage); + }) + .then(function(oid) { + return odb.read(oid); + }) + .then(function(object) { + assert(object.type(), Obj.TYPE.TAG); + }); + }); }); From 4df78f59b8ca1a3f3db79705c835fdb8a4a36dac Mon Sep 17 00:00:00 2001 From: Li Zhao Date: Tue, 10 Jan 2017 12:46:28 +0800 Subject: [PATCH 21/53] escape the spaces in dir for shell command --- lifecycleScripts/configureLibssh2.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lifecycleScripts/configureLibssh2.js b/lifecycleScripts/configureLibssh2.js index 23acd1ff0..4036a4fdd 100644 --- a/lifecycleScripts/configureLibssh2.js +++ b/lifecycleScripts/configureLibssh2.js @@ -1,6 +1,10 @@ var cp = require("child_process"); var path = require("path"); -var rooted = path.join.bind(path, __dirname, ".."); +var rooted = function (dir) { + var fullPath = path.join(__dirname, "..", dir); + var escapedPathForShell = fullPath.replace(/ /g, "\\ "); + return escapedPathForShell; +}; module.exports = function retrieveExternalDependencies() { if (process.platform === "win32") { From 178862be2b5275f2fae874dfd55ba455e67da1c1 Mon Sep 17 00:00:00 2001 From: tyler wanek Date: Tue, 24 Jan 2017 10:41:29 -0700 Subject: [PATCH 22/53] build against shared library for libcurl --- generate/templates/templates/binding.gyp | 13 +++++++++++-- vendor/libgit2.gyp | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index 457221dcd..6bea6d409 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -88,13 +88,22 @@ } } } - ], [ + ], + [ + "OS=='linux' or OS=='mac'", { + "libraries": [ + "-lcurl" + ] + } + ], + [ "OS=='linux' and ' Date: Wed, 25 Jan 2017 15:06:02 -0700 Subject: [PATCH 23/53] Adding GIT_CURL flag for OSX First pass of proxyOpts normalization --- generate/input/libgit2-supplement.json | 4 ++++ lib/remote.js | 8 ++++++++ vendor/libgit2.gyp | 10 ++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/generate/input/libgit2-supplement.json b/generate/input/libgit2-supplement.json index 0e46a5686..b686795c3 100644 --- a/generate/input/libgit2-supplement.json +++ b/generate/input/libgit2-supplement.json @@ -481,6 +481,10 @@ "name": "prune", "type": "git_fetch_prune_t" }, + { + "name": "proxy_opts", + "type": "git_proxy_options" + }, { "name": "update_fetchhead", "type": "int" diff --git a/lib/remote.js b/lib/remote.js index 4cd7e43a4..024796866 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -85,11 +85,14 @@ Remote.prototype.download = function(refspecs, opts) { */ Remote.prototype.fetch = function(refspecs, opts, reflog_message) { var callbacks; + var proxyOpts; if (opts) { opts = shallowClone(opts); callbacks = opts.callbacks; + proxyOpts = opts.proxyOpts; delete opts.callbacks; + delete opts.proxyOpts; } else { opts = {}; } @@ -101,6 +104,11 @@ Remote.prototype.fetch = function(refspecs, opts, reflog_message) { normalizeOptions(callbacks, NodeGit.RemoteCallbacks); } + if (proxyOpts) { + opts.proxyOpts = + normalizeOptions(proxyOpts, NodeGit.ProxyOptions); + } + return _fetch.call(this, refspecs, opts, reflog_message); }; diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 22229ebad..b1e4347bc 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -279,15 +279,21 @@ } } }], + ["OS=='mac' or OS=='linux' or OS.endswith('bsd')", { + "cflags": [ + "-DGIT_CURL" + ], + "defines": [ + "GIT_CURL" + ] + }], ["OS=='linux' or OS.endswith('bsd')" , { "cflags": [ - "-DGIT_CURL", "-DGIT_SSH", "-DGIT_SSL", "-w", ], "defines": [ - "GIT_CURL", "GIT_OPENSSL", "GIT_USE_STAT_MTIM" ], From 8213d3313a24bbbd4e4cdf184512b20e92427cf3 Mon Sep 17 00:00:00 2001 From: Christopher Bargren Date: Wed, 25 Jan 2017 15:32:07 -0700 Subject: [PATCH 24/53] Adding normalizeFetchOptions util --- generate/templates/templates/nodegit.js | 1 + lib/clone.js | 17 ++-------- lib/remote.js | 28 ++-------------- lib/utils/normalize_fetch_options.js | 43 +++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 41 deletions(-) create mode 100644 lib/utils/normalize_fetch_options.js diff --git a/generate/templates/templates/nodegit.js b/generate/templates/templates/nodegit.js index da27db6cd..7a15c7ac0 100644 --- a/generate/templates/templates/nodegit.js +++ b/generate/templates/templates/nodegit.js @@ -78,6 +78,7 @@ var importExtension = function(name) { rawApi.Utils = {}; require("./utils/lookup_wrapper"); require("./utils/normalize_options"); +require("./utils/normalize_fetch_options"); require("./utils/shallow_clone"); // Load up extra types; diff --git a/lib/clone.js b/lib/clone.js index 8dab5c3c3..d81e1a5da 100644 --- a/lib/clone.js +++ b/lib/clone.js @@ -1,5 +1,6 @@ var NodeGit = require("../"); var shallowClone = NodeGit.Utils.shallowClone; +var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; var normalizeOptions = NodeGit.Utils.normalizeOptions; var Clone = NodeGit.Clone; @@ -15,29 +16,15 @@ var _clone = Clone.clone; * @return {Repository} repo */ Clone.clone = function(url, local_path, options) { - var remoteCallbacks = {}; - var fetchOpts = {}; + var fetchOpts = normalizeFetchOptions(options && options.fetchOpts); if (options) { options = shallowClone(options); - if (options.fetchOpts) { - fetchOpts = shallowClone(options.fetchOpts); - } delete options.fetchOpts; } options = normalizeOptions(options, NodeGit.CloneOptions); - if (fetchOpts.callbacks) { - remoteCallbacks = shallowClone(fetchOpts.callbacks); - delete fetchOpts.callbacks; - } - - fetchOpts = normalizeOptions(fetchOpts, NodeGit.FetchOptions); - - fetchOpts.callbacks = - normalizeOptions(remoteCallbacks, NodeGit.RemoteCallbacks); - if (options) { options.fetchOpts = fetchOpts; } diff --git a/lib/remote.js b/lib/remote.js index 024796866..5ec0dea4c 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -1,4 +1,5 @@ var NodeGit = require("../"); +var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; var normalizeOptions = NodeGit.Utils.normalizeOptions; var lookupWrapper = NodeGit.Utils.lookupWrapper; var shallowClone = NodeGit.Utils.shallowClone; @@ -84,32 +85,7 @@ Remote.prototype.download = function(refspecs, opts) { * @return {Number} error code */ Remote.prototype.fetch = function(refspecs, opts, reflog_message) { - var callbacks; - var proxyOpts; - - if (opts) { - opts = shallowClone(opts); - callbacks = opts.callbacks; - proxyOpts = opts.proxyOpts; - delete opts.callbacks; - delete opts.proxyOpts; - } else { - opts = {}; - } - - opts = normalizeOptions(opts, NodeGit.FetchOptions); - - if (callbacks) { - opts.callbacks = - normalizeOptions(callbacks, NodeGit.RemoteCallbacks); - } - - if (proxyOpts) { - opts.proxyOpts = - normalizeOptions(proxyOpts, NodeGit.ProxyOptions); - } - - return _fetch.call(this, refspecs, opts, reflog_message); + return _fetch.call(this, refspecs, normalizeFetchOptions(opts), reflog_message); }; /** diff --git a/lib/utils/normalize_fetch_options.js b/lib/utils/normalize_fetch_options.js new file mode 100644 index 000000000..1615a0683 --- /dev/null +++ b/lib/utils/normalize_fetch_options.js @@ -0,0 +1,43 @@ +var NodeGit = require("../../"); +var normalizeOptions = require("./normalize_options"); +var shallowClone = require("./shallow_clone"); + +/** + * Normalize an object to match a struct. + * + * @param {String, Object} oid - The oid string or instance. + * @return {Object} An Oid instance. + */ +function normalizeFetchOptions(options) { + if (options instanceof NodeGit.FetchOptions) { + return options; + } + + var callbacks; + var proxyOpts; + + if (options) { + options = shallowClone(options); + callbacks = options.callbacks; + proxyOpts = options.proxyOpts; + delete options.callbacks; + delete options.proxyOpts; + } else { + options = {}; + } + + options = normalizeOptions(options, NodeGit.FetchOptions); + + if (callbacks) { + options.callbacks = + normalizeOptions(callbacks, NodeGit.RemoteCallbacks); + } + + if (proxyOpts) { + options.proxyOpts = + normalizeOptions(proxyOpts, NodeGit.ProxyOptions); + } + return options; +} + +NodeGit.Utils.normalizeFetchOptions = normalizeFetchOptions; From 7f040862c752d55942b717ef596b85c52fdcc8b7 Mon Sep 17 00:00:00 2001 From: tyler wanek Date: Wed, 25 Jan 2017 16:06:23 -0700 Subject: [PATCH 25/53] Ensure all options are normalized for proxy options --- lib/remote.js | 58 +++++++++++++++++++++++++++++++++++++++++++----- lib/submodule.js | 30 +++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 5 deletions(-) diff --git a/lib/remote.js b/lib/remote.js index 5ec0dea4c..47fac857e 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -9,6 +9,7 @@ var _connect = Remote.prototype.connect; var _download = Remote.prototype.download; var _fetch = Remote.prototype.fetch; var _push = Remote.prototype.push; +var _upload = Remote.prototype.upload; /** * Retrieves the remote by name @@ -54,24 +55,61 @@ Remote.prototype.connect = function( * @return {Number} error code */ Remote.prototype.download = function(refspecs, opts) { + return _download + .call(this, refspecs, normalizeFetchOptions(opts)); +}; + +/** + * Connects to a remote + * + * @async + * @param {Array} refSpecs The ref specs that should be pushed + * @param {FetchOptions} opts The fetch options for download, contains callbacks + * @param {String} message The message to use for the update reflog messages + * @param {Function} callback + * @return {Number} error code + */ +Remote.prototype.fetch = function(refspecs, opts, reflog_message) { + return _fetch + .call(this, refspecs, normalizeFetchOptions(opts), reflog_message); +}; + +/** + * Pushes to a remote + * + * @async + * @param {Array} refSpecs The ref specs that should be pushed + * @param {PushOptions} options Options for the checkout + * @param {Function} callback + * @return {Number} error code + */ +Remote.prototype.push = function(refSpecs, opts) { var callbacks; + var proxyOpts; if (opts) { opts = shallowClone(opts); callbacks = opts.callbacks; + proxyOpts = opts.proxyOpts; delete opts.callbacks; + delete opts.proxyOpts; } else { opts = {}; } - opts = normalizeOptions(opts, NodeGit.FetchOptions); + opts = normalizeOptions(opts, NodeGit.PushOptions); if (callbacks) { opts.callbacks = normalizeOptions(callbacks, NodeGit.RemoteCallbacks); } - return _download.call(this, refspecs, opts); + if (proxyOpts) { + opts.proxyOpts = + normalizeOptions(proxyOpts, NodeGit.ProxyOptions); + } + + return _push.call(this, refSpecs, opts); }; /** @@ -85,7 +123,8 @@ Remote.prototype.download = function(refspecs, opts) { * @return {Number} error code */ Remote.prototype.fetch = function(refspecs, opts, reflog_message) { - return _fetch.call(this, refspecs, normalizeFetchOptions(opts), reflog_message); + return _fetch + .call(this, refspecs, normalizeFetchOptions(opts), reflog_message); }; /** @@ -97,12 +136,16 @@ Remote.prototype.fetch = function(refspecs, opts, reflog_message) { * @param {Function} callback * @return {Number} error code */ -Remote.prototype.push = function(refSpecs, opts) { +Remote.prototype.upload = function(refSpecs, opts) { var callbacks; + var proxyOpts; + if (opts) { opts = shallowClone(opts); callbacks = opts.callbacks; + proxyOpts = opts.proxyOpts; delete opts.callbacks; + delete opts.proxyOpts; } else { opts = {}; } @@ -114,5 +157,10 @@ Remote.prototype.push = function(refSpecs, opts) { normalizeOptions(callbacks, NodeGit.RemoteCallbacks); } - return _push.call(this, refSpecs, opts); + if (proxyOpts) { + opts.proxyOpts = + normalizeOptions(proxyOpts, NodeGit.ProxyOptions); + } + + return _upload.call(this, refSpecs, opts); }; diff --git a/lib/submodule.js b/lib/submodule.js index 2b0cb530d..534fb2c9c 100644 --- a/lib/submodule.js +++ b/lib/submodule.js @@ -1,10 +1,40 @@ var NodeGit = require("../"); +var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions; +var normalizeOptions = NodeGit.Utils.normalizeOptions; +var shallowClone = NodeGit.Utils.shallowClone; var Submodule = NodeGit.Submodule; var _foreach = Submodule.foreach; +var _update = Submodule.prototype.update; // Override Submodule.foreach to eliminate the need to pass null payload Submodule.foreach = function(repo, callback) { return _foreach(repo, callback, null); }; + +/** + * Updates a submodule + * + * @async + * @param {Number} init Setting this to 1 will initialize submodule + * before updating + * @param {SubmoduleUpdateOptions} options Submodule update settings + * @return {Number} 0 on success, any non-zero return value from a callback + */ +Submodule.prototype.update = function(init, options) { + var fetchOpts = normalizeFetchOptions(options && options.fetchOpts); + + if (options) { + options = shallowClone(options); + delete options.fetchOpts; + } + + options = normalizeOptions(options, NodeGit.SubmoduleUpdateOptions); + + if (options) { + options.fetchOpts = fetchOpts; + } + + return _update.call(this, init, options); +}; From 308f0ae247ebe096a58f11f226421c2f0d26e070 Mon Sep 17 00:00:00 2001 From: tyler wanek Date: Thu, 26 Jan 2017 08:21:38 -0700 Subject: [PATCH 26/53] access normalizeOptions and shallowClone properly --- generate/templates/templates/nodegit.js | 2 +- lib/utils/normalize_fetch_options.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generate/templates/templates/nodegit.js b/generate/templates/templates/nodegit.js index 7a15c7ac0..84bc558b8 100644 --- a/generate/templates/templates/nodegit.js +++ b/generate/templates/templates/nodegit.js @@ -78,8 +78,8 @@ var importExtension = function(name) { rawApi.Utils = {}; require("./utils/lookup_wrapper"); require("./utils/normalize_options"); -require("./utils/normalize_fetch_options"); require("./utils/shallow_clone"); +require("./utils/normalize_fetch_options"); // Load up extra types; require("./status_file"); diff --git a/lib/utils/normalize_fetch_options.js b/lib/utils/normalize_fetch_options.js index 1615a0683..2b4370705 100644 --- a/lib/utils/normalize_fetch_options.js +++ b/lib/utils/normalize_fetch_options.js @@ -1,6 +1,6 @@ var NodeGit = require("../../"); -var normalizeOptions = require("./normalize_options"); -var shallowClone = require("./shallow_clone"); +var normalizeOptions = NodeGit.Utils.normalizeOptions; +var shallowClone = NodeGit.Utils.shallowClone; /** * Normalize an object to match a struct. From ffbd6a3f930d83dc67f0ccdb63f774460e005973 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Tue, 17 Jan 2017 18:25:57 +0900 Subject: [PATCH 27/53] Correct parameter documentation for tree(*) The treeish parameter claims that an Oid is valid but the underlying git_checkout_tree C api does not actually support Oid as a parameter. The JavaScript function does however take a String. Fix the documentation to replace Oid with String as a valid parameter. --- lib/checkout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkout.js b/lib/checkout.js index 652f6116a..f99e27fd0 100644 --- a/lib/checkout.js +++ b/lib/checkout.js @@ -40,7 +40,7 @@ Checkout.index = function(repo, index, options) { * * @async * @param {Repository} repo -* @param {Oid|Tree|Commit|Reference} treeish +* @param {String|Tree|Commit|Reference} treeish * @param {CheckoutOptions} [options] * @return {Void} checkout complete */ From 1269fd71b63c41f6f7ba22c1966efee17b1aaf12 Mon Sep 17 00:00:00 2001 From: John Haley Date: Fri, 27 Jan 2017 08:37:46 -0700 Subject: [PATCH 28/53] Remove Node v0.12 and v5 v0.12 is breaking the deploy process now and v5 should be removed in favor of v7 which will come in a later commit. --- .travis.yml | 34 +++++++--------------------------- appveyor.yml | 6 ++---- package.json | 2 +- 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index d17cd1fa9..1e180fbdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,22 +13,14 @@ sudo: false env: matrix: - - export NODE_VERSION="0.12" TARGET_ARCH="x64" - - export NODE_VERSION="4.5" TARGET_ARCH="x64" - - export NODE_VERSION="5.12" TARGET_ARCH="x64" + - export NODE_VERSION="4" TARGET_ARCH="x64" - export NODE_VERSION="6.5" TARGET_ARCH="x64" matrix: fast_finish: true include: - os: linux - env: export NODE_VERSION="0.12" TARGET_ARCH="ia32" - sudo: required - - os: linux - env: export NODE_VERSION="4.5" TARGET_ARCH="ia32" - sudo: required - - os: linux - env: export NODE_VERSION="5.12" TARGET_ARCH="ia32" + env: export NODE_VERSION="4" TARGET_ARCH="ia32" sudo: required - os: linux env: export NODE_VERSION="6.5" TARGET_ARCH="ia32" @@ -52,6 +44,7 @@ before_install: - export CC=clang - export CXX=clang++ - export npm_config_clang=1 + - export JOBS=4 - if [ $TARGET_ARCH == "ia32" ]; then sudo ln -s /usr/include/asm-generic /usr/include/asm; @@ -64,9 +57,8 @@ before_install: - nvm install $NODE_VERSION - - if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then + - if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "6" ]; then export GYP_DEFINES="coverage=1 use_obsolete_asm=true"; - export JOBS=4; export CC=/usr/bin/gcc-4.9; export CXX=/usr/bin/g++-4.9; export npm_config_clang=0; @@ -74,22 +66,10 @@ before_install: tar xvfz lcov-1.10.tar.gz; else export GYP_DEFINES="use_obsolete_asm=true"; - export JOBS=4; fi -# node 0.12 is sometimes failing -# with a "Callback called more than once" error -# Despite that error, it seems like modules do get installed correctly, -# and the rest of the build proceeds as normal. -# So we ignore that error, just for node 0.12 -# If npm install ever fails in a more significant way, -# the rest of the build should hopefully fail anyway. install: - - if [[ $NODE_VERSION == "0.12" ]]; then - npm install || true; - else - npm install; - fi + - npm install; # This is a random private key used purely for testing. before_script: @@ -104,7 +84,7 @@ before_script: script: - if [ $TARGET_ARCH == "x64" ]; then - if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then + if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "6" ]; then npm test && npm run cov && npm run coveralls; else npm test; @@ -122,7 +102,7 @@ after_success: node-pre-gyp publish --target_arch=$TARGET_ARCH; fi - - if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "4.1" ] && [ $TARGET_ARCH == "x64" ]; then + - if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "6" ] && [ $TARGET_ARCH == "x64" ]; then .travis/deploy-docs.sh; fi diff --git a/appveyor.yml b/appveyor.yml index da168034d..f26318270 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,10 +27,8 @@ environment: GYP_MSVS_VERSION: 2013 matrix: # Node.js - - nodejs_version: "0.12" - - nodejs_version: "4.5" - - nodejs_version: "5.12" - - nodejs_version: "6.5" + - nodejs_version: "4" + - nodejs_version: "6" matrix: fast_finish: true diff --git a/package.json b/package.json index 30c2158fb..6397a14db 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "lib": "./lib" }, "engines": { - "node": ">= 0.12" + "node": ">= 4" }, "dependencies": { "fs-extra": "~0.26.2", From 75114d1e7a5e6f3a99f544fda4c9939d5ffce93d Mon Sep 17 00:00:00 2001 From: John Haley Date: Fri, 27 Jan 2017 08:29:53 -0700 Subject: [PATCH 29/53] Update `Repository#createBranch` docs Fixes #1182 --- lib/repository.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/repository.js b/lib/repository.js index 87d000f40..1a4e6eaa8 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -391,8 +391,6 @@ Repository.prototype.continueRebase = function(signature, beforeNextFn) { * @param {String} name Branch name, e.g. "master" * @param {Commit|String|Oid} commit The commit the branch will point to * @param {bool} force Overwrite branch if it exists - * @param {Signature} signature Identity to use to populate reflog - * @param {String} logMessage One line message to be appended to the reflog * @return {Reference} */ Repository.prototype.createBranch = function(name, commit, force) { From 9fa1a3260bae7d8673a60d2c78a20f73ca76fa62 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Sat, 28 Jan 2017 19:25:56 +0900 Subject: [PATCH 30/53] Make `Branch.createFromAnnotated` async The function was originally synchronous which meant it would return something on regardless of whether it succeeded (a branch) or failed (an error code). This forces the client to have to check whether the returned object is an error code or an object. Change the function to be asynchronous instead so that clients can use the resolved or rejected promise to easily determine whether the branch was successfully created or not. --- generate/input/descriptor.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index 044757eda..bc628cb3d 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -183,6 +183,7 @@ } }, "git_branch_create_from_annotated": { + "isAsync": true, "args": { "ref_out": { "isReturn": true @@ -193,6 +194,9 @@ "force": { "isOptional": true } + }, + "return": { + "isErrorCode": true } }, "git_branch_next": { From b88d332d9ca5b51194d336bcb503e9288995655c Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Fri, 6 Jan 2017 16:14:46 +0900 Subject: [PATCH 31/53] Added tests for Branch move lookup createFromAnnotated --- test/tests/branch.js | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/test/tests/branch.js b/test/tests/branch.js index 8e69020a8..8d587c019 100644 --- a/test/tests/branch.js +++ b/test/tests/branch.js @@ -6,9 +6,14 @@ describe("Branch", function() { var NodeGit = require("../../"); var Repository = NodeGit.Repository; var Branch = NodeGit.Branch; + var AnnotatedCommit = NodeGit.AnnotatedCommit; var branchName = "test-branch"; + var branchName2 = "test-branch2"; var fullBranchName = "refs/heads/" + branchName; + var fullBranchName2 = "refs/heads/" + branchName2; var upstreamName = "origin/master"; + var fullUpstreamName = "refs/remotes/origin/master"; + var nonHeadCommit = "c82fb078a192ea221c9f1093c64321c60d64aa0d"; var reposPath = local("../repos/workdir"); @@ -27,6 +32,8 @@ describe("Branch", function() { }) .then(function(branch) { test.branch = branch; + return test.repository.createBranch( + branchName2, test.masterCommit, true); }); }); @@ -77,4 +84,63 @@ describe("Branch", function() { assert.equal(branchNameToTest, branchName); }); }); + + it("can rename a branch", function() { + var branch = this.branch; + + // don't force the move + return Branch.move(branch, branchName2, 0) + .then(function(branch) { + return Promise.reject(new Error( + "should not be able to rename the branch")); + }, function(error) { + return Promise.resolve() + .then(function() { + // force the move + return Branch.move(branch, branchName2, 1); + }) + .then(function(branch) { + assert.equal(branch.name(), fullBranchName2); + }); + }); + }); + + it("can lookup a branch", function() { + var repo = this.repository; + + return Branch.lookup(repo, branchName, Branch.BRANCH.LOCAL) + .then(function(branch) { + assert.equal(branch.name(), fullBranchName); + return Branch.lookup(repo, upstreamName, Branch.BRANCH.REMOTE); + }) + .then(function(branch) { + assert.equal(branch.name(), fullUpstreamName); + }); + }); + + it("can create branch from annotated commit", function() { + var repo = this.repository; + var annotatedCommit = null; + + return AnnotatedCommit.fromRevspec(repo, nonHeadCommit) + .then(function(theAnnotatedCommit) { + annotatedCommit = theAnnotatedCommit; + return Branch.createFromAnnotated( + repo, branchName, annotatedCommit, 0); + }) + .then(function(branch) { + return Promise.reject(new Error( + "should not be able to create the branch")); + }, function(error) { + return Promise.resolve() + .then(function() { + // force the branch creation + return Branch.createFromAnnotated( + repo, branchName, annotatedCommit, 1); + }) + .then(function(branch) { + assert.equal(branch.name(), fullBranchName); + }); + }); + }); }); From 25157ea4131aaa5a9a34213003a2a5a79d68a66a Mon Sep 17 00:00:00 2001 From: Tim Branyen Date: Sat, 28 Jan 2017 16:24:34 -0800 Subject: [PATCH 32/53] Builds NodeGit on Node 7.4.0 --- .travis.yml | 4 ++++ appveyor.yml | 1 + package.json | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1e180fbdd..e4602d8ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ env: matrix: - export NODE_VERSION="4" TARGET_ARCH="x64" - export NODE_VERSION="6.5" TARGET_ARCH="x64" + - export NODE_VERSION="7.4" TARGET_ARCH="x64" matrix: fast_finish: true @@ -25,6 +26,9 @@ matrix: - os: linux env: export NODE_VERSION="6.5" TARGET_ARCH="ia32" sudo: required + - os: linux + env: export NODE_VERSION="7.4" TARGET_ARCH="ia32" + sudo: required git: depth: 1 diff --git a/appveyor.yml b/appveyor.yml index f26318270..5f7172f5c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,6 +29,7 @@ environment: # Node.js - nodejs_version: "4" - nodejs_version: "6" + - nodejs_version: "7" matrix: fast_finish: true diff --git a/package.json b/package.json index 6397a14db..99a566a81 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "fs-extra": "~0.26.2", "lodash": "^4.13.1", "nan": "^2.2.0", - "node-gyp": "^3.3.1", - "node-pre-gyp": "~0.6.15", + "node-gyp": "^3.5.0", + "node-pre-gyp": "~0.6.32", "promisify-node": "~0.3.0" }, "devDependencies": { From c0a8d9787c5b71f6c661087b55ee27f1195ef7ee Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Sun, 29 Jan 2017 09:28:49 +0900 Subject: [PATCH 33/53] Provide target repository to write the index to The returned Index from Merge.commits() doesn't know where to write the index to because it is not backed by a repository. This prevents the example from running because the write() fails as it's only in-memory and has no notion of a target .git/index file. Skip the write() and just use writeTreeTo() immediately instead to write the index to the sample repository. --- examples/merge-cleanly.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/merge-cleanly.js b/examples/merge-cleanly.js index c338cb90f..8e3028315 100644 --- a/examples/merge-cleanly.js +++ b/examples/merge-cleanly.js @@ -116,10 +116,7 @@ fse.remove(path.resolve(__dirname, repoDir)) // the repository instead of just writing it. .then(function(index) { if (!index.hasConflicts()) { - return index.write() - .then(function() { - return index.writeTreeTo(repository); - }); + return index.writeTreeTo(repository); } }) From 15cecff9d1bbbaf66d511970b8b791d5ea6433ac Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Sun, 29 Jan 2017 08:51:51 +0900 Subject: [PATCH 34/53] Specify acceptable types for `lookup` and `dwim` Make it clear to the client that only Commits and Tags are valid parameters. --- lib/reset.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/reset.js b/lib/reset.js index 6c5933817..0f304d6be 100644 --- a/lib/reset.js +++ b/lib/reset.js @@ -10,8 +10,8 @@ var _reset = Reset.reset; * * @async * @param {Repository} repo Repository where to perform the reset operation. - * @param {Object} target The committish which content will be used to reset the - * content of the index. + * @param {Commit|Tag} target The committish which content will be used to reset + * the content of the index. * @param {Strarray} pathspecs List of pathspecs to operate on. * * @return {Number} 0 on success or an error code @@ -26,11 +26,12 @@ Reset.default = function(repo, target, pathspecs) { * @async * @param {Repository} repo Repository where to perform the reset operation. * - * @param {Object} target Committish to which the Head should be moved to. This - * object must belong to the given `repo` and can either - * be a git_commit or a git_tag. When a git_tag is being - * passed, it should be dereferencable to a git_commit - * which oid will be used as the target of the branch. + * @param {Commit|Tag} target Committish to which the Head should be moved to. + * This object must belong to the given `repo` and can + * either be a git_commit or a git_tag. When a git_tag is + * being passed, it should be dereferencable to a + * git_commit which oid will be used as the target of the + * branch. * @param {Number} resetType Kind of reset operation to perform. * * @param {CheckoutOptions} opts Checkout options to be used for a HARD reset. From a40faac626c6374e19684eb78929da5d21ea0e7b Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Tue, 10 Jan 2017 12:55:07 -0700 Subject: [PATCH 35/53] Move libgit2 submodule to 0.25.1 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 37dba1a73..2fcb8705e 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 37dba1a739b5ee6c45dc9f3c0bd1f7f7a18f13f7 +Subproject commit 2fcb8705e584ca61f6c4657525c9d2713f6a39d2 From 3fb927422cfd1e360dcf2505f7a0dc70b6c68d6a Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Tue, 10 Jan 2017 12:58:33 -0700 Subject: [PATCH 36/53] Update libgit2-docs.json --- generate/input/libgit2-docs.json | 1675 ++++++++++++++++++++---------- 1 file changed, 1105 insertions(+), 570 deletions(-) diff --git a/generate/input/libgit2-docs.json b/generate/input/libgit2-docs.json index 9357295f6..34a478605 100644 --- a/generate/input/libgit2-docs.json +++ b/generate/input/libgit2-docs.json @@ -53,7 +53,6 @@ "git_blob_filtered_content", "git_blob_create_fromworkdir", "git_blob_create_fromdisk", - "git_blob_create_fromchunks", "git_blob_create_fromstream", "git_blob_create_fromstream_commit", "git_blob_create_frombuffer", @@ -61,7 +60,7 @@ "git_blob_dup" ], "meta": {}, - "lines": 269 + "lines": 228 }, { "file": "branch.h", @@ -106,7 +105,7 @@ "git_checkout_tree" ], "meta": {}, - "lines": 354 + "lines": 361 }, { "file": "cherrypick.h", @@ -173,7 +172,7 @@ "git_libgit2_opts" ], "meta": {}, - "lines": 282 + "lines": 284 }, { "file": "config.h", @@ -271,9 +270,11 @@ "git_diff_foreach", "git_diff_status_char", "git_diff_print", + "git_diff_to_buf", "git_diff_blobs", "git_diff_blob_to_buffer", "git_diff_buffers", + "git_diff_from_buffer", "git_diff_get_stats", "git_diff_stats_files_changed", "git_diff_stats_insertions", @@ -285,7 +286,7 @@ "git_diff_format_email_init_options" ], "meta": {}, - "lines": 1346 + "lines": 1401 }, { "file": "errors.h", @@ -296,7 +297,7 @@ "giterr_set_oom" ], "meta": {}, - "lines": 144 + "lines": 145 }, { "file": "filter.h", @@ -352,6 +353,8 @@ "git_index_owner", "git_index_caps", "git_index_set_caps", + "git_index_version", + "git_index_set_version", "git_index_read", "git_index_write", "git_index_path", @@ -386,7 +389,7 @@ "git_index_conflict_iterator_free" ], "meta": {}, - "lines": 780 + "lines": 805 }, { "file": "indexer.h", @@ -709,6 +712,7 @@ "git_reference_list", "git_reference_foreach", "git_reference_foreach_name", + "git_reference_dup", "git_reference_free", "git_reference_cmp", "git_reference_iterator_new", @@ -729,7 +733,7 @@ "git_reference_shorthand" ], "meta": {}, - "lines": 730 + "lines": 741 }, { "file": "refspec.h", @@ -841,7 +845,7 @@ "git_repository_set_ident" ], "meta": {}, - "lines": 752 + "lines": 771 }, { "file": "reset.h", @@ -896,7 +900,7 @@ "git_revwalk_add_hide_cb" ], "meta": {}, - "lines": 293 + "lines": 291 }, { "file": "signature.h", @@ -904,11 +908,12 @@ "git_signature_new", "git_signature_now", "git_signature_default", + "git_signature_from_buffer", "git_signature_dup", "git_signature_free" ], "meta": {}, - "lines": 86 + "lines": 99 }, { "file": "stash.h", @@ -988,11 +993,12 @@ "git_submodule_location" ], "meta": {}, - "lines": 633 + "lines": 641 }, { "file": "sys/commit.h", "functions": [ + "git_commit_create_from_ids", "git_commit_create_from_callback" ], "meta": {}, @@ -1024,6 +1030,7 @@ "git_filter_lookup", "git_filter_list_new", "git_filter_list_push", + "git_filter_list_length", "git_filter_source_repo", "git_filter_source_path", "git_filter_source_filemode", @@ -1044,6 +1051,7 @@ { "file": "sys/hashsig.h", "functions": [ + "git_hashsig_create", "git_hashsig_create_fromfile", "git_hashsig_free", "git_hashsig_compare" @@ -1076,7 +1084,7 @@ "git_odb_init_backend" ], "meta": {}, - "lines": 106 + "lines": 117 }, { "file": "sys/openssl.h", @@ -1128,6 +1136,14 @@ "meta": {}, "lines": 54 }, + { + "file": "sys/time.h", + "functions": [ + "git_time_monotonic" + ], + "meta": {}, + "lines": 27 + }, { "file": "sys/transport.h", "functions": [ @@ -1236,10 +1252,11 @@ "git_treebuilder_write", "git_treewalk_cb", "git_tree_walk", - "git_tree_dup" + "git_tree_dup", + "git_tree_create_updated" ], "meta": {}, - "lines": 419 + "lines": 465 }, { "file": "types.h", @@ -2172,53 +2189,11 @@ "comments": "", "group": "blob" }, - "git_blob_create_fromchunks": { - "type": "function", - "file": "blob.h", - "line": 187, - "lineto": 192, - "args": [ - { - "name": "id", - "type": "git_oid *", - "comment": "Return the id of the written blob" - }, - { - "name": "repo", - "type": "git_repository *", - "comment": "Repository where the blob will be written.\n This repository can be bare or not." - }, - { - "name": "hintpath", - "type": "const char *", - "comment": "If not NULL, will be used to select data filters\n to apply onto the content of the blob to be created." - }, - { - "name": "callback", - "type": "git_blob_chunk_cb", - "comment": null - }, - { - "name": "payload", - "type": "void *", - "comment": null - } - ], - "argline": "git_oid *id, git_repository *repo, const char *hintpath, git_blob_chunk_cb callback, void *payload", - "sig": "git_oid *::git_repository *::const char *::git_blob_chunk_cb::void *", - "return": { - "type": "int", - "comment": " 0 or error code (from either libgit2 or callback function)" - }, - "description": "

Write a loose blob to the Object Database from a\n provider of chunks of data.

\n", - "comments": "

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n\n

The implementation of the callback MUST respect the following rules:

\n\n
    \n
  • content must be filled by the callback. The maximum number of bytes that the buffer can accept per call is defined by the max_length parameter. Allocation and freeing of the buffer will be taken care of by libgit2.

  • \n
  • The callback must return the number of bytes that have been written to the content buffer.

  • \n
  • When there is no more data to stream, callback should return 0. This will prevent it from being invoked anymore.

  • \n
  • If an error occurs, the callback should return a negative value. This value will be returned to the caller.

  • \n
\n", - "group": "blob" - }, "git_blob_create_fromstream": { "type": "function", "file": "blob.h", - "line": 219, - "lineto": 222, + "line": 178, + "lineto": 181, "args": [ { "name": "out", @@ -2249,8 +2224,8 @@ "git_blob_create_fromstream_commit": { "type": "function", "file": "blob.h", - "line": 233, - "lineto": 235, + "line": 192, + "lineto": 194, "args": [ { "name": "out", @@ -2276,8 +2251,8 @@ "git_blob_create_frombuffer": { "type": "function", "file": "blob.h", - "line": 246, - "lineto": 247, + "line": 205, + "lineto": 206, "args": [ { "name": "id", @@ -2313,8 +2288,8 @@ "git_blob_is_binary": { "type": "function", "file": "blob.h", - "line": 260, - "lineto": 260, + "line": 219, + "lineto": 219, "args": [ { "name": "blob", @@ -2335,8 +2310,8 @@ "git_blob_dup": { "type": "function", "file": "blob.h", - "line": 269, - "lineto": 269, + "line": 228, + "lineto": 228, "args": [ { "name": "out", @@ -2894,8 +2869,8 @@ "git_checkout_head": { "type": "function", "file": "checkout.h", - "line": 322, - "lineto": 324, + "line": 329, + "lineto": 331, "args": [ { "name": "repo", @@ -2915,14 +2890,14 @@ "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use giterr_last for error details)" }, "description": "

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n", - "comments": "", + "comments": "

Note that this is not the correct mechanism used to switch branches; do not change your HEAD and then call this method, that would leave you with checkout conflicts since your working directory would then appear to be dirty. Instead, checkout the target of the branch and then update HEAD using git_repository_set_head to point to the branch you checked out.

\n", "group": "checkout" }, "git_checkout_index": { "type": "function", "file": "checkout.h", - "line": 335, - "lineto": 338, + "line": 342, + "lineto": 345, "args": [ { "name": "repo", @@ -2953,8 +2928,8 @@ "git_checkout_tree": { "type": "function", "file": "checkout.h", - "line": 351, - "lineto": 354, + "line": 358, + "lineto": 361, "args": [ { "name": "repo", @@ -4253,8 +4228,8 @@ "git_libgit2_opts": { "type": "function", "file": "common.h", - "line": 282, - "lineto": 282, + "line": 284, + "lineto": 284, "args": [ { "name": "option", @@ -4269,7 +4244,7 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set or query a library global option

\n", - "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time        by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k        > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Either parameter may be `NULL`, but not both.\n\n* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)\n\n    > Set the value of the User-Agent header.  This value will be       > appended to "git/1.0", for compatibility with other git clients.      >       > - `user_agent` is the value that will be delivered as the     >   User-Agent header on HTTP requests.\n\n* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)\n\n    > Enable strict input validation when creating new objects      > to ensure that all inputs to the new objects are valid.  For      > example, when this is enabled, the parent(s) and tree inputs      > will be validated when creating a new commit.  This defaults      > to disabled.  * opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)\n\n    > Set the SSL ciphers use for HTTPS connections.        >       > - `ciphers` is the list of ciphers that are eanbled.\n
\n", + "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time        by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k        > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Either parameter may be `NULL`, but not both.\n\n* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)\n\n    > Set the value of the User-Agent header.  This value will be       > appended to "git/1.0", for compatibility with other git clients.      >       > - `user_agent` is the value that will be delivered as the     >   User-Agent header on HTTP requests.\n\n* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)\n\n    > Enable strict input validation when creating new objects      > to ensure that all inputs to the new objects are valid.  For      > example, when this is enabled, the parent(s) and tree inputs      > will be validated when creating a new commit.  This defaults      > to enabled.\n\n* opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)\n\n    > Set the SSL ciphers use for HTTPS connections.        >       > - `ciphers` is the list of ciphers that are eanbled.\n
\n", "group": "libgit2" }, "git_config_entry_free": { @@ -5746,8 +5721,8 @@ "git_diff_init_options": { "type": "function", "file": "diff.h", - "line": 435, - "lineto": 437, + "line": 441, + "lineto": 443, "args": [ { "name": "opts", @@ -5773,8 +5748,8 @@ "git_diff_find_init_options": { "type": "function", "file": "diff.h", - "line": 720, - "lineto": 722, + "line": 736, + "lineto": 738, "args": [ { "name": "opts", @@ -5800,8 +5775,8 @@ "git_diff_free": { "type": "function", "file": "diff.h", - "line": 736, - "lineto": 736, + "line": 752, + "lineto": 752, "args": [ { "name": "diff", @@ -5831,8 +5806,8 @@ "git_diff_tree_to_tree": { "type": "function", "file": "diff.h", - "line": 754, - "lineto": 759, + "line": 770, + "lineto": 775, "args": [ { "name": "diff", @@ -5882,8 +5857,8 @@ "git_diff_tree_to_index": { "type": "function", "file": "diff.h", - "line": 780, - "lineto": 785, + "line": 796, + "lineto": 801, "args": [ { "name": "diff", @@ -5929,8 +5904,8 @@ "git_diff_index_to_workdir": { "type": "function", "file": "diff.h", - "line": 807, - "lineto": 811, + "line": 823, + "lineto": 827, "args": [ { "name": "diff", @@ -5971,8 +5946,8 @@ "git_diff_tree_to_workdir": { "type": "function", "file": "diff.h", - "line": 836, - "lineto": 840, + "line": 852, + "lineto": 856, "args": [ { "name": "diff", @@ -6013,8 +5988,8 @@ "git_diff_tree_to_workdir_with_index": { "type": "function", "file": "diff.h", - "line": 855, - "lineto": 859, + "line": 871, + "lineto": 875, "args": [ { "name": "diff", @@ -6055,8 +6030,8 @@ "git_diff_index_to_index": { "type": "function", "file": "diff.h", - "line": 873, - "lineto": 878, + "line": 889, + "lineto": 894, "args": [ { "name": "diff", @@ -6097,8 +6072,8 @@ "git_diff_merge": { "type": "function", "file": "diff.h", - "line": 893, - "lineto": 895, + "line": 909, + "lineto": 911, "args": [ { "name": "onto", @@ -6124,8 +6099,8 @@ "git_diff_find_similar": { "type": "function", "file": "diff.h", - "line": 909, - "lineto": 911, + "line": 925, + "lineto": 927, "args": [ { "name": "diff", @@ -6156,8 +6131,8 @@ "git_diff_num_deltas": { "type": "function", "file": "diff.h", - "line": 929, - "lineto": 929, + "line": 945, + "lineto": 945, "args": [ { "name": "diff", @@ -6183,8 +6158,8 @@ "git_diff_num_deltas_of_type": { "type": "function", "file": "diff.h", - "line": 942, - "lineto": 943, + "line": 958, + "lineto": 959, "args": [ { "name": "diff", @@ -6210,8 +6185,8 @@ "git_diff_get_delta": { "type": "function", "file": "diff.h", - "line": 962, - "lineto": 963, + "line": 978, + "lineto": 979, "args": [ { "name": "diff", @@ -6237,8 +6212,8 @@ "git_diff_is_sorted_icase": { "type": "function", "file": "diff.h", - "line": 971, - "lineto": 971, + "line": 987, + "lineto": 987, "args": [ { "name": "diff", @@ -6259,8 +6234,8 @@ "git_diff_foreach": { "type": "function", "file": "diff.h", - "line": 999, - "lineto": 1005, + "line": 1015, + "lineto": 1021, "args": [ { "name": "diff", @@ -6306,8 +6281,8 @@ "git_diff_status_char": { "type": "function", "file": "diff.h", - "line": 1018, - "lineto": 1018, + "line": 1034, + "lineto": 1034, "args": [ { "name": "status", @@ -6328,8 +6303,8 @@ "git_diff_print": { "type": "function", "file": "diff.h", - "line": 1043, - "lineto": 1047, + "line": 1059, + "lineto": 1063, "args": [ { "name": "diff", @@ -6370,11 +6345,43 @@ ] } }, + "git_diff_to_buf": { + "type": "function", + "file": "diff.h", + "line": 1075, + "lineto": 1078, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "A pointer to a user-allocated git_buf that will\n contain the diff text" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + }, + { + "name": "format", + "type": "git_diff_format_t", + "comment": "A git_diff_format_t value to pick the text format." + } + ], + "argline": "git_buf *out, git_diff *diff, git_diff_format_t format", + "sig": "git_buf *::git_diff *::git_diff_format_t", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Produce the complete formatted text output from a diff into a\n buffer.

\n", + "comments": "", + "group": "diff" + }, "git_diff_blobs": { "type": "function", "file": "diff.h", - "line": 1084, - "lineto": 1094, + "line": 1115, + "lineto": 1125, "args": [ { "name": "old_blob", @@ -6440,8 +6447,8 @@ "git_diff_blob_to_buffer": { "type": "function", "file": "diff.h", - "line": 1121, - "lineto": 1132, + "line": 1152, + "lineto": 1163, "args": [ { "name": "old_blob", @@ -6512,8 +6519,8 @@ "git_diff_buffers": { "type": "function", "file": "diff.h", - "line": 1155, - "lineto": 1167, + "line": 1186, + "lineto": 1198, "args": [ { "name": "old_buffer", @@ -6586,11 +6593,43 @@ "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n", "group": "diff" }, + "git_diff_from_buffer": { + "type": "function", + "file": "diff.h", + "line": 1219, + "lineto": 1222, + "args": [ + { + "name": "out", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "content", + "type": "const char *", + "comment": "The contents of a patch file" + }, + { + "name": "content_len", + "type": "size_t", + "comment": "The length of the patch file contents" + } + ], + "argline": "git_diff **out, const char *content, size_t content_len", + "sig": "git_diff **::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Read the contents of a git patch file into a git_diff object.

\n", + "comments": "

The diff object produced is similar to the one that would be produced if you actually produced it computationally by comparing two trees, however there may be subtle differences. For example, a patch file likely contains abbreviated object IDs, so the object IDs in a git_diff_delta produced by this function will also be abbreviated.

\n\n

This function will only read patch files created by a git implementation, it will not read unified diffs produced by the diff program, nor any other types of patch files.

\n", + "group": "diff" + }, "git_diff_get_stats": { "type": "function", "file": "diff.h", - "line": 1203, - "lineto": 1205, + "line": 1258, + "lineto": 1260, "args": [ { "name": "out", @@ -6621,8 +6660,8 @@ "git_diff_stats_files_changed": { "type": "function", "file": "diff.h", - "line": 1213, - "lineto": 1214, + "line": 1268, + "lineto": 1269, "args": [ { "name": "stats", @@ -6643,8 +6682,8 @@ "git_diff_stats_insertions": { "type": "function", "file": "diff.h", - "line": 1222, - "lineto": 1223, + "line": 1277, + "lineto": 1278, "args": [ { "name": "stats", @@ -6665,8 +6704,8 @@ "git_diff_stats_deletions": { "type": "function", "file": "diff.h", - "line": 1231, - "lineto": 1232, + "line": 1286, + "lineto": 1287, "args": [ { "name": "stats", @@ -6687,8 +6726,8 @@ "git_diff_stats_to_buf": { "type": "function", "file": "diff.h", - "line": 1243, - "lineto": 1247, + "line": 1298, + "lineto": 1302, "args": [ { "name": "out", @@ -6729,8 +6768,8 @@ "git_diff_stats_free": { "type": "function", "file": "diff.h", - "line": 1255, - "lineto": 1255, + "line": 1310, + "lineto": 1310, "args": [ { "name": "stats", @@ -6756,8 +6795,8 @@ "git_diff_format_email": { "type": "function", "file": "diff.h", - "line": 1307, - "lineto": 1310, + "line": 1362, + "lineto": 1365, "args": [ { "name": "out", @@ -6788,8 +6827,8 @@ "git_diff_commit_as_email": { "type": "function", "file": "diff.h", - "line": 1326, - "lineto": 1333, + "line": 1381, + "lineto": 1388, "args": [ { "name": "out", @@ -6840,8 +6879,8 @@ "git_diff_format_email_init_options": { "type": "function", "file": "diff.h", - "line": 1344, - "lineto": 1346, + "line": 1399, + "lineto": 1401, "args": [ { "name": "opts", @@ -6867,8 +6906,8 @@ "giterr_last": { "type": "function", "file": "errors.h", - "line": 110, - "lineto": 110, + "line": 111, + "lineto": 111, "args": [], "argline": "", "sig": "", @@ -6895,8 +6934,8 @@ "giterr_clear": { "type": "function", "file": "errors.h", - "line": 115, - "lineto": 115, + "line": 116, + "lineto": 116, "args": [], "argline": "", "sig": "", @@ -6911,8 +6950,8 @@ "giterr_set_str": { "type": "function", "file": "errors.h", - "line": 133, - "lineto": 133, + "line": 134, + "lineto": 134, "args": [ { "name": "error_class", @@ -6938,8 +6977,8 @@ "giterr_set_oom": { "type": "function", "file": "errors.h", - "line": 144, - "lineto": 144, + "line": 145, + "lineto": 145, "args": [], "argline": "", "sig": "", @@ -7659,11 +7698,60 @@ "comments": "

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", "group": "index" }, + "git_index_version": { + "type": "function", + "file": "index.h", + "line": 264, + "lineto": 264, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { + "type": "unsigned int", + "comment": " the index version" + }, + "description": "

Get index on-disk version.

\n", + "comments": "

Valid return values are 2, 3, or 4. If 3 is returned, an index with version 2 may be written instead, if the extension data in version 3 is not necessary.

\n", + "group": "index" + }, + "git_index_set_version": { + "type": "function", + "file": "index.h", + "line": 277, + "lineto": 277, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "The new version number" + } + ], + "argline": "git_index *index, unsigned int version", + "sig": "git_index *::unsigned int", + "return": { + "type": "int", + "comment": " 0 on success, -1 on failure" + }, + "description": "

Set index on-disk version.

\n", + "comments": "

Valid values are 2, 3, or 4. If 2 is given, git_index_write may write an index with version 3 instead, if necessary to accurately represent the index.

\n", + "group": "index" + }, "git_index_read": { "type": "function", "file": "index.h", - "line": 271, - "lineto": 271, + "line": 296, + "lineto": 296, "args": [ { "name": "index", @@ -7689,8 +7777,8 @@ "git_index_write": { "type": "function", "file": "index.h", - "line": 280, - "lineto": 280, + "line": 305, + "lineto": 305, "args": [ { "name": "index", @@ -7711,8 +7799,8 @@ "git_index_path": { "type": "function", "file": "index.h", - "line": 288, - "lineto": 288, + "line": 313, + "lineto": 313, "args": [ { "name": "index", @@ -7733,8 +7821,8 @@ "git_index_checksum": { "type": "function", "file": "index.h", - "line": 300, - "lineto": 300, + "line": 325, + "lineto": 325, "args": [ { "name": "index", @@ -7755,8 +7843,8 @@ "git_index_read_tree": { "type": "function", "file": "index.h", - "line": 311, - "lineto": 311, + "line": 336, + "lineto": 336, "args": [ { "name": "index", @@ -7782,8 +7870,8 @@ "git_index_write_tree": { "type": "function", "file": "index.h", - "line": 332, - "lineto": 332, + "line": 357, + "lineto": 357, "args": [ { "name": "out", @@ -7814,8 +7902,8 @@ "git_index_write_tree_to": { "type": "function", "file": "index.h", - "line": 349, - "lineto": 349, + "line": 374, + "lineto": 374, "args": [ { "name": "out", @@ -7846,8 +7934,8 @@ "git_index_entrycount": { "type": "function", "file": "index.h", - "line": 368, - "lineto": 368, + "line": 393, + "lineto": 393, "args": [ { "name": "index", @@ -7873,8 +7961,8 @@ "git_index_clear": { "type": "function", "file": "index.h", - "line": 379, - "lineto": 379, + "line": 404, + "lineto": 404, "args": [ { "name": "index", @@ -7895,8 +7983,8 @@ "git_index_get_byindex": { "type": "function", "file": "index.h", - "line": 392, - "lineto": 393, + "line": 417, + "lineto": 418, "args": [ { "name": "index", @@ -7927,8 +8015,8 @@ "git_index_get_bypath": { "type": "function", "file": "index.h", - "line": 407, - "lineto": 408, + "line": 432, + "lineto": 433, "args": [ { "name": "index", @@ -7959,8 +8047,8 @@ "git_index_remove": { "type": "function", "file": "index.h", - "line": 418, - "lineto": 418, + "line": 443, + "lineto": 443, "args": [ { "name": "index", @@ -7991,8 +8079,8 @@ "git_index_remove_directory": { "type": "function", "file": "index.h", - "line": 428, - "lineto": 429, + "line": 453, + "lineto": 454, "args": [ { "name": "index", @@ -8023,8 +8111,8 @@ "git_index_add": { "type": "function", "file": "index.h", - "line": 445, - "lineto": 445, + "line": 470, + "lineto": 470, "args": [ { "name": "index", @@ -8050,8 +8138,8 @@ "git_index_entry_stage": { "type": "function", "file": "index.h", - "line": 457, - "lineto": 457, + "line": 482, + "lineto": 482, "args": [ { "name": "entry", @@ -8072,8 +8160,8 @@ "git_index_entry_is_conflict": { "type": "function", "file": "index.h", - "line": 466, - "lineto": 466, + "line": 491, + "lineto": 491, "args": [ { "name": "entry", @@ -8094,8 +8182,8 @@ "git_index_add_bypath": { "type": "function", "file": "index.h", - "line": 497, - "lineto": 497, + "line": 522, + "lineto": 522, "args": [ { "name": "index", @@ -8121,8 +8209,8 @@ "git_index_add_frombuffer": { "type": "function", "file": "index.h", - "line": 526, - "lineto": 529, + "line": 551, + "lineto": 554, "args": [ { "name": "index", @@ -8158,8 +8246,8 @@ "git_index_remove_bypath": { "type": "function", "file": "index.h", - "line": 545, - "lineto": 545, + "line": 570, + "lineto": 570, "args": [ { "name": "index", @@ -8185,8 +8273,8 @@ "git_index_add_all": { "type": "function", "file": "index.h", - "line": 592, - "lineto": 597, + "line": 617, + "lineto": 622, "args": [ { "name": "index", @@ -8227,8 +8315,8 @@ "git_index_remove_all": { "type": "function", "file": "index.h", - "line": 614, - "lineto": 618, + "line": 639, + "lineto": 643, "args": [ { "name": "index", @@ -8264,8 +8352,8 @@ "git_index_update_all": { "type": "function", "file": "index.h", - "line": 643, - "lineto": 647, + "line": 668, + "lineto": 672, "args": [ { "name": "index", @@ -8301,8 +8389,8 @@ "git_index_find": { "type": "function", "file": "index.h", - "line": 658, - "lineto": 658, + "line": 683, + "lineto": 683, "args": [ { "name": "at_pos", @@ -8333,8 +8421,8 @@ "git_index_find_prefix": { "type": "function", "file": "index.h", - "line": 669, - "lineto": 669, + "line": 694, + "lineto": 694, "args": [ { "name": "at_pos", @@ -8365,8 +8453,8 @@ "git_index_conflict_add": { "type": "function", "file": "index.h", - "line": 694, - "lineto": 698, + "line": 719, + "lineto": 723, "args": [ { "name": "index", @@ -8402,8 +8490,8 @@ "git_index_conflict_get": { "type": "function", "file": "index.h", - "line": 714, - "lineto": 719, + "line": 739, + "lineto": 744, "args": [ { "name": "ancestor_out", @@ -8444,8 +8532,8 @@ "git_index_conflict_remove": { "type": "function", "file": "index.h", - "line": 728, - "lineto": 728, + "line": 753, + "lineto": 753, "args": [ { "name": "index", @@ -8471,8 +8559,8 @@ "git_index_conflict_cleanup": { "type": "function", "file": "index.h", - "line": 736, - "lineto": 736, + "line": 761, + "lineto": 761, "args": [ { "name": "index", @@ -8493,8 +8581,8 @@ "git_index_has_conflicts": { "type": "function", "file": "index.h", - "line": 743, - "lineto": 743, + "line": 768, + "lineto": 768, "args": [ { "name": "index", @@ -8515,8 +8603,8 @@ "git_index_conflict_iterator_new": { "type": "function", "file": "index.h", - "line": 754, - "lineto": 756, + "line": 779, + "lineto": 781, "args": [ { "name": "iterator_out", @@ -8542,8 +8630,8 @@ "git_index_conflict_next": { "type": "function", "file": "index.h", - "line": 768, - "lineto": 772, + "line": 793, + "lineto": 797, "args": [ { "name": "ancestor_out", @@ -8579,8 +8667,8 @@ "git_index_conflict_iterator_free": { "type": "function", "file": "index.h", - "line": 779, - "lineto": 780, + "line": 804, + "lineto": 805, "args": [ { "name": "iterator", @@ -10075,7 +10163,8 @@ "ex/HEAD/cat-file.html#git_object_type2string-21" ], "general.c": [ - "ex/HEAD/general.html#git_object_type2string-33" + "ex/HEAD/general.html#git_object_type2string-33", + "ex/HEAD/general.html#git_object_type2string-34" ] } }, @@ -10343,7 +10432,7 @@ "ex/HEAD/cat-file.html#git_odb_read-23" ], "general.c": [ - "ex/HEAD/general.html#git_odb_read-34" + "ex/HEAD/general.html#git_odb_read-35" ] } }, @@ -10614,7 +10703,7 @@ "group": "odb", "examples": { "general.c": [ - "ex/HEAD/general.html#git_odb_write-35" + "ex/HEAD/general.html#git_odb_write-36" ] } }, @@ -10959,7 +11048,7 @@ "ex/HEAD/cat-file.html#git_odb_object_free-24" ], "general.c": [ - "ex/HEAD/general.html#git_odb_object_free-36" + "ex/HEAD/general.html#git_odb_object_free-37" ] } }, @@ -11008,7 +11097,7 @@ "group": "odb", "examples": { "general.c": [ - "ex/HEAD/general.html#git_odb_object_data-37" + "ex/HEAD/general.html#git_odb_object_data-38" ] } }, @@ -11038,7 +11127,7 @@ "ex/HEAD/cat-file.html#git_odb_object_size-25" ], "general.c": [ - "ex/HEAD/general.html#git_odb_object_size-38" + "ex/HEAD/general.html#git_odb_object_size-39" ] } }, @@ -11065,7 +11154,7 @@ "group": "odb", "examples": { "general.c": [ - "ex/HEAD/general.html#git_odb_object_type-39" + "ex/HEAD/general.html#git_odb_object_type-40" ] } }, @@ -11316,14 +11405,14 @@ "group": "oid", "examples": { "general.c": [ - "ex/HEAD/general.html#git_oid_fromstr-40", "ex/HEAD/general.html#git_oid_fromstr-41", "ex/HEAD/general.html#git_oid_fromstr-42", "ex/HEAD/general.html#git_oid_fromstr-43", "ex/HEAD/general.html#git_oid_fromstr-44", "ex/HEAD/general.html#git_oid_fromstr-45", "ex/HEAD/general.html#git_oid_fromstr-46", - "ex/HEAD/general.html#git_oid_fromstr-47" + "ex/HEAD/general.html#git_oid_fromstr-47", + "ex/HEAD/general.html#git_oid_fromstr-48" ] } }, @@ -11441,11 +11530,12 @@ "group": "oid", "examples": { "general.c": [ - "ex/HEAD/general.html#git_oid_fmt-48", "ex/HEAD/general.html#git_oid_fmt-49", "ex/HEAD/general.html#git_oid_fmt-50", "ex/HEAD/general.html#git_oid_fmt-51", - "ex/HEAD/general.html#git_oid_fmt-52" + "ex/HEAD/general.html#git_oid_fmt-52", + "ex/HEAD/general.html#git_oid_fmt-53", + "ex/HEAD/general.html#git_oid_fmt-54" ], "network/fetch.c": [ "ex/HEAD/network/fetch.html#git_oid_fmt-1", @@ -12202,7 +12292,7 @@ "argline": "git_packbuilder *pb", "sig": "git_packbuilder *", "return": { - "type": "uint32_t", + "type": "size_t", "comment": " the number of objects in the packfile" }, "description": "

Get the total number of objects the packbuilder will write out

\n", @@ -12224,7 +12314,7 @@ "argline": "git_packbuilder *pb", "sig": "git_packbuilder *", "return": { - "type": "uint32_t", + "type": "size_t", "comment": " the number of objects which have already been written" }, "description": "

Get the number of objects the packbuilder has already written out

\n", @@ -12634,7 +12724,7 @@ "sig": "const git_patch *::size_t", "return": { "type": "int", - "comment": " Number of lines in hunk or -1 if invalid hunk index" + "comment": " Number of lines in hunk or GIT_ENOTFOUND if invalid hunk index" }, "description": "

Get the number of lines in a hunk.

\n", "comments": "", @@ -14012,7 +14102,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/HEAD/general.html#git_reference_lookup-53" + "ex/HEAD/general.html#git_reference_lookup-55" ] } }, @@ -14301,7 +14391,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/HEAD/general.html#git_reference_target-54" + "ex/HEAD/general.html#git_reference_target-56" ] } }, @@ -14350,7 +14440,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/HEAD/general.html#git_reference_symbolic_target-55" + "ex/HEAD/general.html#git_reference_symbolic_target-57" ] } }, @@ -14377,7 +14467,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/HEAD/general.html#git_reference_type-56" + "ex/HEAD/general.html#git_reference_type-58" ] } }, @@ -14645,7 +14735,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/HEAD/general.html#git_reference_list-57" + "ex/HEAD/general.html#git_reference_list-59" ] } }, @@ -14713,11 +14803,38 @@ "comments": "

The callback function will be called for each reference in the repository, receiving the name of the reference and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", "group": "reference" }, + "git_reference_dup": { + "type": "function", + "file": "refs.h", + "line": 473, + "lineto": 473, + "args": [ + { + "name": "dest", + "type": "git_reference **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "git_reference *", + "comment": "object to copy" + } + ], + "argline": "git_reference **dest, git_reference *source", + "sig": "git_reference **::git_reference *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a copy of an existing reference.

\n", + "comments": "

Call git_reference_free to free the data.

\n", + "group": "reference" + }, "git_reference_free": { "type": "function", "file": "refs.h", - "line": 469, - "lineto": 469, + "line": 480, + "lineto": 480, "args": [ { "name": "ref", @@ -14743,8 +14860,8 @@ "git_reference_cmp": { "type": "function", "file": "refs.h", - "line": 478, - "lineto": 480, + "line": 489, + "lineto": 491, "args": [ { "name": "ref1", @@ -14770,8 +14887,8 @@ "git_reference_iterator_new": { "type": "function", "file": "refs.h", - "line": 489, - "lineto": 491, + "line": 500, + "lineto": 502, "args": [ { "name": "out", @@ -14797,8 +14914,8 @@ "git_reference_iterator_glob_new": { "type": "function", "file": "refs.h", - "line": 502, - "lineto": 505, + "line": 513, + "lineto": 516, "args": [ { "name": "out", @@ -14829,8 +14946,8 @@ "git_reference_next": { "type": "function", "file": "refs.h", - "line": 514, - "lineto": 514, + "line": 525, + "lineto": 525, "args": [ { "name": "out", @@ -14856,8 +14973,8 @@ "git_reference_next_name": { "type": "function", "file": "refs.h", - "line": 527, - "lineto": 527, + "line": 538, + "lineto": 538, "args": [ { "name": "out", @@ -14883,8 +15000,8 @@ "git_reference_iterator_free": { "type": "function", "file": "refs.h", - "line": 534, - "lineto": 534, + "line": 545, + "lineto": 545, "args": [ { "name": "iter", @@ -14905,8 +15022,8 @@ "git_reference_foreach_glob": { "type": "function", "file": "refs.h", - "line": 554, - "lineto": 558, + "line": 565, + "lineto": 569, "args": [ { "name": "repo", @@ -14942,8 +15059,8 @@ "git_reference_has_log": { "type": "function", "file": "refs.h", - "line": 568, - "lineto": 568, + "line": 579, + "lineto": 579, "args": [ { "name": "repo", @@ -14969,8 +15086,8 @@ "git_reference_ensure_log": { "type": "function", "file": "refs.h", - "line": 580, - "lineto": 580, + "line": 591, + "lineto": 591, "args": [ { "name": "repo", @@ -14996,8 +15113,8 @@ "git_reference_is_branch": { "type": "function", "file": "refs.h", - "line": 590, - "lineto": 590, + "line": 601, + "lineto": 601, "args": [ { "name": "ref", @@ -15018,8 +15135,8 @@ "git_reference_is_remote": { "type": "function", "file": "refs.h", - "line": 600, - "lineto": 600, + "line": 611, + "lineto": 611, "args": [ { "name": "ref", @@ -15040,8 +15157,8 @@ "git_reference_is_tag": { "type": "function", "file": "refs.h", - "line": 610, - "lineto": 610, + "line": 621, + "lineto": 621, "args": [ { "name": "ref", @@ -15062,8 +15179,8 @@ "git_reference_is_note": { "type": "function", "file": "refs.h", - "line": 620, - "lineto": 620, + "line": 631, + "lineto": 631, "args": [ { "name": "ref", @@ -15084,8 +15201,8 @@ "git_reference_normalize_name": { "type": "function", "file": "refs.h", - "line": 676, - "lineto": 680, + "line": 687, + "lineto": 691, "args": [ { "name": "buffer_out", @@ -15121,8 +15238,8 @@ "git_reference_peel": { "type": "function", "file": "refs.h", - "line": 697, - "lineto": 700, + "line": 708, + "lineto": 711, "args": [ { "name": "out", @@ -15153,8 +15270,8 @@ "git_reference_is_valid_name": { "type": "function", "file": "refs.h", - "line": 716, - "lineto": 716, + "line": 727, + "lineto": 727, "args": [ { "name": "refname", @@ -15175,8 +15292,8 @@ "git_reference_shorthand": { "type": "function", "file": "refs.h", - "line": 730, - "lineto": 730, + "line": 741, + "lineto": 741, "args": [ { "name": "ref", @@ -16718,7 +16835,7 @@ "group": "repository", "examples": { "general.c": [ - "ex/HEAD/general.html#git_repository_open-58" + "ex/HEAD/general.html#git_repository_open-60" ], "network/git2.c": [ "ex/HEAD/network/git2.html#git_repository_open-5" @@ -16800,8 +16917,8 @@ "git_repository_open_ext": { "type": "function", "file": "repository.h", - "line": 122, - "lineto": 126, + "line": 141, + "lineto": 145, "args": [ { "name": "out", @@ -16811,7 +16928,7 @@ { "name": "path", "type": "const char *", - "comment": "Path to open as git repository. If the flags\n permit \"searching\", then this can be a path to a subdirectory\n inside the working directory of the repository." + "comment": "Path to open as git repository. If the flags\n permit \"searching\", then this can be a path to a subdirectory\n inside the working directory of the repository. May be NULL if\n flags is GIT_REPOSITORY_OPEN_FROM_ENV." }, { "name": "flags", @@ -16864,8 +16981,8 @@ "git_repository_open_bare": { "type": "function", "file": "repository.h", - "line": 139, - "lineto": 139, + "line": 158, + "lineto": 158, "args": [ { "name": "out", @@ -16891,8 +17008,8 @@ "git_repository_free": { "type": "function", "file": "repository.h", - "line": 152, - "lineto": 152, + "line": 171, + "lineto": 171, "args": [ { "name": "repo", @@ -16923,7 +17040,7 @@ "ex/HEAD/diff.html#git_repository_free-16" ], "general.c": [ - "ex/HEAD/general.html#git_repository_free-59" + "ex/HEAD/general.html#git_repository_free-61" ], "init.c": [ "ex/HEAD/init.html#git_repository_free-6" @@ -16951,8 +17068,8 @@ "git_repository_init": { "type": "function", "file": "repository.h", - "line": 169, - "lineto": 172, + "line": 188, + "lineto": 191, "args": [ { "name": "out", @@ -16988,8 +17105,8 @@ "git_repository_init_init_options": { "type": "function", "file": "repository.h", - "line": 281, - "lineto": 283, + "line": 300, + "lineto": 302, "args": [ { "name": "opts", @@ -17015,8 +17132,8 @@ "git_repository_init_ext": { "type": "function", "file": "repository.h", - "line": 298, - "lineto": 301, + "line": 317, + "lineto": 320, "args": [ { "name": "out", @@ -17052,8 +17169,8 @@ "git_repository_head": { "type": "function", "file": "repository.h", - "line": 316, - "lineto": 316, + "line": 335, + "lineto": 335, "args": [ { "name": "out", @@ -17084,8 +17201,8 @@ "git_repository_head_detached": { "type": "function", "file": "repository.h", - "line": 328, - "lineto": 328, + "line": 347, + "lineto": 347, "args": [ { "name": "repo", @@ -17106,8 +17223,8 @@ "git_repository_head_unborn": { "type": "function", "file": "repository.h", - "line": 340, - "lineto": 340, + "line": 359, + "lineto": 359, "args": [ { "name": "repo", @@ -17128,8 +17245,8 @@ "git_repository_is_empty": { "type": "function", "file": "repository.h", - "line": 352, - "lineto": 352, + "line": 371, + "lineto": 371, "args": [ { "name": "repo", @@ -17150,8 +17267,8 @@ "git_repository_path": { "type": "function", "file": "repository.h", - "line": 363, - "lineto": 363, + "line": 382, + "lineto": 382, "args": [ { "name": "repo", @@ -17180,8 +17297,8 @@ "git_repository_workdir": { "type": "function", "file": "repository.h", - "line": 374, - "lineto": 374, + "line": 393, + "lineto": 393, "args": [ { "name": "repo", @@ -17207,8 +17324,8 @@ "git_repository_set_workdir": { "type": "function", "file": "repository.h", - "line": 393, - "lineto": 394, + "line": 412, + "lineto": 413, "args": [ { "name": "repo", @@ -17239,8 +17356,8 @@ "git_repository_is_bare": { "type": "function", "file": "repository.h", - "line": 402, - "lineto": 402, + "line": 421, + "lineto": 421, "args": [ { "name": "repo", @@ -17266,8 +17383,8 @@ "git_repository_config": { "type": "function", "file": "repository.h", - "line": 418, - "lineto": 418, + "line": 437, + "lineto": 437, "args": [ { "name": "out", @@ -17293,8 +17410,8 @@ "git_repository_config_snapshot": { "type": "function", "file": "repository.h", - "line": 434, - "lineto": 434, + "line": 453, + "lineto": 453, "args": [ { "name": "out", @@ -17320,8 +17437,8 @@ "git_repository_odb": { "type": "function", "file": "repository.h", - "line": 450, - "lineto": 450, + "line": 469, + "lineto": 469, "args": [ { "name": "out", @@ -17348,15 +17465,15 @@ "ex/HEAD/cat-file.html#git_repository_odb-33" ], "general.c": [ - "ex/HEAD/general.html#git_repository_odb-60" + "ex/HEAD/general.html#git_repository_odb-62" ] } }, "git_repository_refdb": { "type": "function", "file": "repository.h", - "line": 466, - "lineto": 466, + "line": 485, + "lineto": 485, "args": [ { "name": "out", @@ -17382,8 +17499,8 @@ "git_repository_index": { "type": "function", "file": "repository.h", - "line": 482, - "lineto": 482, + "line": 501, + "lineto": 501, "args": [ { "name": "out", @@ -17407,7 +17524,7 @@ "group": "repository", "examples": { "general.c": [ - "ex/HEAD/general.html#git_repository_index-61" + "ex/HEAD/general.html#git_repository_index-63" ], "init.c": [ "ex/HEAD/init.html#git_repository_index-11" @@ -17417,8 +17534,8 @@ "git_repository_message": { "type": "function", "file": "repository.h", - "line": 500, - "lineto": 500, + "line": 519, + "lineto": 519, "args": [ { "name": "out", @@ -17444,8 +17561,8 @@ "git_repository_message_remove": { "type": "function", "file": "repository.h", - "line": 507, - "lineto": 507, + "line": 526, + "lineto": 526, "args": [ { "name": "repo", @@ -17466,8 +17583,8 @@ "git_repository_state_cleanup": { "type": "function", "file": "repository.h", - "line": 516, - "lineto": 516, + "line": 535, + "lineto": 535, "args": [ { "name": "repo", @@ -17488,8 +17605,8 @@ "git_repository_fetchhead_foreach": { "type": "function", "file": "repository.h", - "line": 535, - "lineto": 538, + "line": 554, + "lineto": 557, "args": [ { "name": "repo", @@ -17520,8 +17637,8 @@ "git_repository_mergehead_foreach": { "type": "function", "file": "repository.h", - "line": 555, - "lineto": 558, + "line": 574, + "lineto": 577, "args": [ { "name": "repo", @@ -17552,8 +17669,8 @@ "git_repository_hashfile": { "type": "function", "file": "repository.h", - "line": 583, - "lineto": 588, + "line": 602, + "lineto": 607, "args": [ { "name": "out", @@ -17594,8 +17711,8 @@ "git_repository_set_head": { "type": "function", "file": "repository.h", - "line": 608, - "lineto": 610, + "line": 627, + "lineto": 629, "args": [ { "name": "repo", @@ -17621,8 +17738,8 @@ "git_repository_set_head_detached": { "type": "function", "file": "repository.h", - "line": 628, - "lineto": 630, + "line": 647, + "lineto": 649, "args": [ { "name": "repo", @@ -17648,8 +17765,8 @@ "git_repository_set_head_detached_from_annotated": { "type": "function", "file": "repository.h", - "line": 644, - "lineto": 646, + "line": 663, + "lineto": 665, "args": [ { "name": "repo", @@ -17675,8 +17792,8 @@ "git_repository_detach_head": { "type": "function", "file": "repository.h", - "line": 665, - "lineto": 666, + "line": 684, + "lineto": 685, "args": [ { "name": "repo", @@ -17697,8 +17814,8 @@ "git_repository_state": { "type": "function", "file": "repository.h", - "line": 696, - "lineto": 696, + "line": 715, + "lineto": 715, "args": [ { "name": "repo", @@ -17719,8 +17836,8 @@ "git_repository_set_namespace": { "type": "function", "file": "repository.h", - "line": 710, - "lineto": 710, + "line": 729, + "lineto": 729, "args": [ { "name": "repo", @@ -17746,8 +17863,8 @@ "git_repository_get_namespace": { "type": "function", "file": "repository.h", - "line": 718, - "lineto": 718, + "line": 737, + "lineto": 737, "args": [ { "name": "repo", @@ -17768,8 +17885,8 @@ "git_repository_is_shallow": { "type": "function", "file": "repository.h", - "line": 727, - "lineto": 727, + "line": 746, + "lineto": 746, "args": [ { "name": "repo", @@ -17790,8 +17907,8 @@ "git_repository_ident": { "type": "function", "file": "repository.h", - "line": 739, - "lineto": 739, + "line": 758, + "lineto": 758, "args": [ { "name": "name", @@ -17822,8 +17939,8 @@ "git_repository_set_ident": { "type": "function", "file": "repository.h", - "line": 752, - "lineto": 752, + "line": 771, + "lineto": 771, "args": [ { "name": "repo", @@ -18199,8 +18316,8 @@ "git_revwalk_new": { "type": "function", "file": "revwalk.h", - "line": 75, - "lineto": 75, + "line": 73, + "lineto": 73, "args": [ { "name": "out", @@ -18224,7 +18341,7 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/HEAD/general.html#git_revwalk_new-62" + "ex/HEAD/general.html#git_revwalk_new-64" ], "log.c": [ "ex/HEAD/log.html#git_revwalk_new-49", @@ -18235,8 +18352,8 @@ "git_revwalk_reset": { "type": "function", "file": "revwalk.h", - "line": 90, - "lineto": 90, + "line": 88, + "lineto": 88, "args": [ { "name": "walker", @@ -18257,8 +18374,8 @@ "git_revwalk_push": { "type": "function", "file": "revwalk.h", - "line": 109, - "lineto": 109, + "line": 107, + "lineto": 107, "args": [ { "name": "walk", @@ -18282,7 +18399,7 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/HEAD/general.html#git_revwalk_push-63" + "ex/HEAD/general.html#git_revwalk_push-65" ], "log.c": [ "ex/HEAD/log.html#git_revwalk_push-51" @@ -18292,8 +18409,8 @@ "git_revwalk_push_glob": { "type": "function", "file": "revwalk.h", - "line": 127, - "lineto": 127, + "line": 125, + "lineto": 125, "args": [ { "name": "walk", @@ -18319,8 +18436,8 @@ "git_revwalk_push_head": { "type": "function", "file": "revwalk.h", - "line": 135, - "lineto": 135, + "line": 133, + "lineto": 133, "args": [ { "name": "walk", @@ -18346,8 +18463,8 @@ "git_revwalk_hide": { "type": "function", "file": "revwalk.h", - "line": 150, - "lineto": 150, + "line": 148, + "lineto": 148, "args": [ { "name": "walk", @@ -18378,8 +18495,8 @@ "git_revwalk_hide_glob": { "type": "function", "file": "revwalk.h", - "line": 169, - "lineto": 169, + "line": 167, + "lineto": 167, "args": [ { "name": "walk", @@ -18405,8 +18522,8 @@ "git_revwalk_hide_head": { "type": "function", "file": "revwalk.h", - "line": 177, - "lineto": 177, + "line": 175, + "lineto": 175, "args": [ { "name": "walk", @@ -18427,8 +18544,8 @@ "git_revwalk_push_ref": { "type": "function", "file": "revwalk.h", - "line": 188, - "lineto": 188, + "line": 186, + "lineto": 186, "args": [ { "name": "walk", @@ -18454,8 +18571,8 @@ "git_revwalk_hide_ref": { "type": "function", "file": "revwalk.h", - "line": 199, - "lineto": 199, + "line": 197, + "lineto": 197, "args": [ { "name": "walk", @@ -18481,8 +18598,8 @@ "git_revwalk_next": { "type": "function", "file": "revwalk.h", - "line": 219, - "lineto": 219, + "line": 217, + "lineto": 217, "args": [ { "name": "out", @@ -18506,7 +18623,7 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/HEAD/general.html#git_revwalk_next-64" + "ex/HEAD/general.html#git_revwalk_next-66" ], "log.c": [ "ex/HEAD/log.html#git_revwalk_next-54" @@ -18516,8 +18633,8 @@ "git_revwalk_sorting": { "type": "function", "file": "revwalk.h", - "line": 230, - "lineto": 230, + "line": 228, + "lineto": 228, "args": [ { "name": "walk", @@ -18541,7 +18658,7 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/HEAD/general.html#git_revwalk_sorting-65" + "ex/HEAD/general.html#git_revwalk_sorting-67" ], "log.c": [ "ex/HEAD/log.html#git_revwalk_sorting-55", @@ -18552,8 +18669,8 @@ "git_revwalk_push_range": { "type": "function", "file": "revwalk.h", - "line": 245, - "lineto": 245, + "line": 243, + "lineto": 243, "args": [ { "name": "walk", @@ -18579,8 +18696,8 @@ "git_revwalk_simplify_first_parent": { "type": "function", "file": "revwalk.h", - "line": 252, - "lineto": 252, + "line": 250, + "lineto": 250, "args": [ { "name": "walk", @@ -18601,8 +18718,8 @@ "git_revwalk_free": { "type": "function", "file": "revwalk.h", - "line": 260, - "lineto": 260, + "line": 258, + "lineto": 258, "args": [ { "name": "walk", @@ -18621,7 +18738,7 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/HEAD/general.html#git_revwalk_free-66" + "ex/HEAD/general.html#git_revwalk_free-68" ], "log.c": [ "ex/HEAD/log.html#git_revwalk_free-57" @@ -18631,8 +18748,8 @@ "git_revwalk_repository": { "type": "function", "file": "revwalk.h", - "line": 269, - "lineto": 269, + "line": 267, + "lineto": 267, "args": [ { "name": "walk", @@ -18653,8 +18770,8 @@ "git_revwalk_add_hide_cb": { "type": "function", "file": "revwalk.h", - "line": 290, - "lineto": 293, + "line": 288, + "lineto": 291, "args": [ { "name": "walk", @@ -18725,8 +18842,8 @@ "group": "signature", "examples": { "general.c": [ - "ex/HEAD/general.html#git_signature_new-67", - "ex/HEAD/general.html#git_signature_new-68" + "ex/HEAD/general.html#git_signature_new-69", + "ex/HEAD/general.html#git_signature_new-70" ] } }, @@ -18797,11 +18914,38 @@ ] } }, + "git_signature_from_buffer": { + "type": "function", + "file": "signature.h", + "line": 76, + "lineto": 76, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature" + }, + { + "name": "buf", + "type": "const char *", + "comment": "signature string" + } + ], + "argline": "git_signature **out, const char *buf", + "sig": "git_signature **::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Create a new signature by parsing the given buffer, which is\n expected to be in the format "Real Name \n<email

\n\n
\n

timestamp tzoffset",\n where timestamp is the number of seconds since the Unix epoch and\n tzoffset is the timezone offset in hhmm format (note the lack\n of a colon separator).

\n
\n", + "comments": "", + "group": "signature" + }, "git_signature_dup": { "type": "function", "file": "signature.h", - "line": 75, - "lineto": 75, + "line": 88, + "lineto": 88, "args": [ { "name": "dest", @@ -18827,8 +18971,8 @@ "git_signature_free": { "type": "function", "file": "signature.h", - "line": 86, - "lineto": 86, + "line": 99, + "lineto": 99, "args": [ { "name": "sig", @@ -19327,7 +19471,7 @@ "group": "strarray", "examples": { "general.c": [ - "ex/HEAD/general.html#git_strarray_free-69" + "ex/HEAD/general.html#git_strarray_free-71" ], "remote.c": [ "ex/HEAD/remote.html#git_strarray_free-16", @@ -19368,8 +19512,8 @@ "git_submodule_update_init_options": { "type": "function", "file": "submodule.h", - "line": 173, - "lineto": 174, + "line": 179, + "lineto": 180, "args": [ { "name": "opts", @@ -19395,8 +19539,8 @@ "git_submodule_update": { "type": "function", "file": "submodule.h", - "line": 192, - "lineto": 192, + "line": 200, + "lineto": 200, "args": [ { "name": "submodule", @@ -19420,15 +19564,15 @@ "type": "int", "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)." }, - "description": "

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n containing repository.

\n", + "description": "

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n the containing repository. If the submodule repository doesn't contain\n the target commit (e.g. because fetchRecurseSubmodules isn't set), then\n the submodule is fetched using the fetch options supplied in options.

\n", "comments": "", "group": "submodule" }, "git_submodule_lookup": { "type": "function", "file": "submodule.h", - "line": 221, - "lineto": 224, + "line": 229, + "lineto": 232, "args": [ { "name": "out", @@ -19459,8 +19603,8 @@ "git_submodule_free": { "type": "function", "file": "submodule.h", - "line": 231, - "lineto": 231, + "line": 239, + "lineto": 239, "args": [ { "name": "submodule", @@ -19481,8 +19625,8 @@ "git_submodule_foreach": { "type": "function", "file": "submodule.h", - "line": 251, - "lineto": 254, + "line": 259, + "lineto": 262, "args": [ { "name": "repo", @@ -19518,8 +19662,8 @@ "git_submodule_add_setup": { "type": "function", "file": "submodule.h", - "line": 281, - "lineto": 286, + "line": 289, + "lineto": 294, "args": [ { "name": "out", @@ -19560,8 +19704,8 @@ "git_submodule_add_finalize": { "type": "function", "file": "submodule.h", - "line": 298, - "lineto": 298, + "line": 306, + "lineto": 306, "args": [ { "name": "submodule", @@ -19582,8 +19726,8 @@ "git_submodule_add_to_index": { "type": "function", "file": "submodule.h", - "line": 310, - "lineto": 312, + "line": 318, + "lineto": 320, "args": [ { "name": "submodule", @@ -19609,8 +19753,8 @@ "git_submodule_owner": { "type": "function", "file": "submodule.h", - "line": 325, - "lineto": 325, + "line": 333, + "lineto": 333, "args": [ { "name": "submodule", @@ -19631,8 +19775,8 @@ "git_submodule_name": { "type": "function", "file": "submodule.h", - "line": 333, - "lineto": 333, + "line": 341, + "lineto": 341, "args": [ { "name": "submodule", @@ -19658,8 +19802,8 @@ "git_submodule_path": { "type": "function", "file": "submodule.h", - "line": 344, - "lineto": 344, + "line": 352, + "lineto": 352, "args": [ { "name": "submodule", @@ -19685,8 +19829,8 @@ "git_submodule_url": { "type": "function", "file": "submodule.h", - "line": 352, - "lineto": 352, + "line": 360, + "lineto": 360, "args": [ { "name": "submodule", @@ -19707,8 +19851,8 @@ "git_submodule_resolve_url": { "type": "function", "file": "submodule.h", - "line": 362, - "lineto": 362, + "line": 370, + "lineto": 370, "args": [ { "name": "out", @@ -19739,8 +19883,8 @@ "git_submodule_branch": { "type": "function", "file": "submodule.h", - "line": 370, - "lineto": 370, + "line": 378, + "lineto": 378, "args": [ { "name": "submodule", @@ -19761,8 +19905,8 @@ "git_submodule_set_branch": { "type": "function", "file": "submodule.h", - "line": 383, - "lineto": 383, + "line": 391, + "lineto": 391, "args": [ { "name": "repo", @@ -19793,8 +19937,8 @@ "git_submodule_set_url": { "type": "function", "file": "submodule.h", - "line": 397, - "lineto": 397, + "line": 405, + "lineto": 405, "args": [ { "name": "repo", @@ -19825,8 +19969,8 @@ "git_submodule_index_id": { "type": "function", "file": "submodule.h", - "line": 405, - "lineto": 405, + "line": 413, + "lineto": 413, "args": [ { "name": "submodule", @@ -19847,8 +19991,8 @@ "git_submodule_head_id": { "type": "function", "file": "submodule.h", - "line": 413, - "lineto": 413, + "line": 421, + "lineto": 421, "args": [ { "name": "submodule", @@ -19869,8 +20013,8 @@ "git_submodule_wd_id": { "type": "function", "file": "submodule.h", - "line": 426, - "lineto": 426, + "line": 434, + "lineto": 434, "args": [ { "name": "submodule", @@ -19891,8 +20035,8 @@ "git_submodule_ignore": { "type": "function", "file": "submodule.h", - "line": 451, - "lineto": 452, + "line": 459, + "lineto": 460, "args": [ { "name": "submodule", @@ -19913,8 +20057,8 @@ "git_submodule_set_ignore": { "type": "function", "file": "submodule.h", - "line": 464, - "lineto": 467, + "line": 472, + "lineto": 475, "args": [ { "name": "repo", @@ -19945,8 +20089,8 @@ "git_submodule_update_strategy": { "type": "function", "file": "submodule.h", - "line": 479, - "lineto": 480, + "line": 487, + "lineto": 488, "args": [ { "name": "submodule", @@ -19967,8 +20111,8 @@ "git_submodule_set_update": { "type": "function", "file": "submodule.h", - "line": 492, - "lineto": 495, + "line": 500, + "lineto": 503, "args": [ { "name": "repo", @@ -19999,8 +20143,8 @@ "git_submodule_fetch_recurse_submodules": { "type": "function", "file": "submodule.h", - "line": 508, - "lineto": 509, + "line": 516, + "lineto": 517, "args": [ { "name": "submodule", @@ -20021,8 +20165,8 @@ "git_submodule_set_fetch_recurse_submodules": { "type": "function", "file": "submodule.h", - "line": 521, - "lineto": 524, + "line": 529, + "lineto": 532, "args": [ { "name": "repo", @@ -20053,8 +20197,8 @@ "git_submodule_init": { "type": "function", "file": "submodule.h", - "line": 539, - "lineto": 539, + "line": 547, + "lineto": 547, "args": [ { "name": "submodule", @@ -20080,8 +20224,8 @@ "git_submodule_repo_init": { "type": "function", "file": "submodule.h", - "line": 554, - "lineto": 557, + "line": 562, + "lineto": 565, "args": [ { "name": "out", @@ -20112,8 +20256,8 @@ "git_submodule_sync": { "type": "function", "file": "submodule.h", - "line": 567, - "lineto": 567, + "line": 575, + "lineto": 575, "args": [ { "name": "submodule", @@ -20134,8 +20278,8 @@ "git_submodule_open": { "type": "function", "file": "submodule.h", - "line": 581, - "lineto": 583, + "line": 589, + "lineto": 591, "args": [ { "name": "repo", @@ -20161,8 +20305,8 @@ "git_submodule_reload": { "type": "function", "file": "submodule.h", - "line": 595, - "lineto": 595, + "line": 603, + "lineto": 603, "args": [ { "name": "submodule", @@ -20188,8 +20332,8 @@ "git_submodule_status": { "type": "function", "file": "submodule.h", - "line": 611, - "lineto": 615, + "line": 619, + "lineto": 623, "args": [ { "name": "status", @@ -20230,8 +20374,8 @@ "git_submodule_location": { "type": "function", "file": "submodule.h", - "line": 631, - "lineto": 633, + "line": 639, + "lineto": 641, "args": [ { "name": "location_status", @@ -20254,6 +20398,73 @@ "comments": "

This is a bit like a very lightweight version of git_submodule_status. It just returns a made of the first four submodule status values (i.e. the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.). This can be useful if you want to know if the submodule is present in the working directory at this point in time, etc.

\n", "group": "submodule" }, + "git_commit_create_from_ids": { + "type": "function", + "file": "sys/commit.h", + "line": 34, + "lineto": 44, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "update_ref", + "type": "const char *", + "comment": null + }, + { + "name": "author", + "type": "const git_signature *", + "comment": null + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": null + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": null + }, + { + "name": "message", + "type": "const char *", + "comment": null + }, + { + "name": "tree", + "type": "const git_oid *", + "comment": null + }, + { + "name": "parent_count", + "type": "size_t", + "comment": null + }, + { + "name": "parents", + "type": "const git_oid *[]", + "comment": null + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create new commit in the repository from a list of git_oid values.

\n", + "comments": "

See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree and parents now take git_oid. This is a dangerous API in that nor the tree, neither the parents list of git_oids are checked for validity.

\n", + "group": "commit" + }, "git_commit_create_from_callback": { "type": "function", "file": "sys/commit.h", @@ -20604,6 +20815,28 @@ "comments": "

Normally you won't have to do this because the filter list is created by calling the "check" function on registered filters when the filter attributes are set, but this does allow more direct manipulation of filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the filter. Using this function, you can either pass in a payload if you know the expected payload format, or you can pass NULL. Some filters may fail with a NULL payload. Good luck!

\n", "group": "filter" }, + "git_filter_list_length": { + "type": "function", + "file": "sys/filter.h", + "line": 90, + "lineto": 90, + "args": [ + { + "name": "fl", + "type": "const git_filter_list *", + "comment": "A filter list" + } + ], + "argline": "const git_filter_list *fl", + "sig": "const git_filter_list *", + "return": { + "type": "size_t", + "comment": " The number of filters in the list" + }, + "description": "

Look up how many filters are in the list

\n", + "comments": "

We will attempt to apply all of these filters to any data passed in, but note that the filter apply action still has the option of skipping data that is passed in (for example, the CRLF filter will skip data that appears to be binary).

\n", + "group": "filter" + }, "git_filter_source_repo": { "type": "function", "file": "sys/filter.h", @@ -20790,6 +21023,43 @@ "comments": "

Attempting to remove the builtin libgit2 filters is not permitted and will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", "group": "filter" }, + "git_hashsig_create": { + "type": "function", + "file": "sys/hashsig.h", + "line": 62, + "lineto": 66, + "args": [ + { + "name": "out", + "type": "git_hashsig **", + "comment": "The computed similarity signature." + }, + { + "name": "buf", + "type": "const char *", + "comment": "The input buffer." + }, + { + "name": "buflen", + "type": "size_t", + "comment": "The input buffer size." + }, + { + "name": "opts", + "type": "git_hashsig_option_t", + "comment": "The signature computation options (see above)." + } + ], + "argline": "git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts", + "sig": "git_hashsig **::const char *::size_t::git_hashsig_option_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." + }, + "description": "

Compute a similarity signature for a text buffer

\n", + "comments": "

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the whitespace will be removed from the buffer while it is being processed, modifying the buffer in place. Sorry about that!

\n", + "group": "hashsig" + }, "git_hashsig_create_fromfile": { "type": "function", "file": "sys/hashsig.h", @@ -20918,8 +21188,8 @@ "git_odb_init_backend": { "type": "function", "file": "sys/odb_backend.h", - "line": 104, - "lineto": 106, + "line": 115, + "lineto": 117, "args": [ { "name": "backend", @@ -21321,6 +21591,22 @@ "comments": "

If a constructor is already set, it will be overwritten. Pass NULL in order to deregister the current constructor.

\n", "group": "stream" }, + "git_time_monotonic": { + "type": "function", + "file": "sys/time.h", + "line": 27, + "lineto": 27, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "double", + "comment": null + }, + "description": "

Return a monotonic time value, useful for measuring running time\n and setting up timeouts.

\n", + "comments": "

The returned value is an arbitrary point in time -- it can only be used when comparing it to another git_time_monotonic call.

\n\n

The time is returned in seconds, with a decimal fraction that differs on accuracy based on the underlying system, but should be least accurate to Nanoseconds.

\n\n

This function cannot fail.

\n", + "group": "time" + }, "git_transport_init": { "type": "function", "file": "sys/transport.h", @@ -21696,7 +21982,7 @@ "group": "tag", "examples": { "general.c": [ - "ex/HEAD/general.html#git_tag_lookup-70" + "ex/HEAD/general.html#git_tag_lookup-72" ] } }, @@ -21831,7 +22117,7 @@ "group": "tag", "examples": { "general.c": [ - "ex/HEAD/general.html#git_tag_target-71" + "ex/HEAD/general.html#git_tag_target-73" ] } }, @@ -21888,7 +22174,7 @@ "ex/HEAD/cat-file.html#git_tag_target_type-36" ], "general.c": [ - "ex/HEAD/general.html#git_tag_target_type-72" + "ex/HEAD/general.html#git_tag_target_type-74" ] } }, @@ -21918,7 +22204,7 @@ "ex/HEAD/cat-file.html#git_tag_name-37" ], "general.c": [ - "ex/HEAD/general.html#git_tag_name-73" + "ex/HEAD/general.html#git_tag_name-75" ], "tag.c": [ "ex/HEAD/tag.html#git_tag_name-20" @@ -21979,7 +22265,7 @@ "ex/HEAD/cat-file.html#git_tag_message-40" ], "general.c": [ - "ex/HEAD/general.html#git_tag_message-74" + "ex/HEAD/general.html#git_tag_message-76" ], "tag.c": [ "ex/HEAD/tag.html#git_tag_message-21" @@ -22736,8 +23022,8 @@ "group": "tree", "examples": { "general.c": [ - "ex/HEAD/general.html#git_tree_lookup-75", - "ex/HEAD/general.html#git_tree_lookup-76" + "ex/HEAD/general.html#git_tree_lookup-77", + "ex/HEAD/general.html#git_tree_lookup-78" ], "init.c": [ "ex/HEAD/init.html#git_tree_lookup-14" @@ -22889,7 +23175,7 @@ "ex/HEAD/cat-file.html#git_tree_entrycount-41" ], "general.c": [ - "ex/HEAD/general.html#git_tree_entrycount-77" + "ex/HEAD/general.html#git_tree_entrycount-79" ] } }, @@ -22921,7 +23207,7 @@ "group": "tree", "examples": { "general.c": [ - "ex/HEAD/general.html#git_tree_entry_byname-78" + "ex/HEAD/general.html#git_tree_entry_byname-80" ] } }, @@ -22956,7 +23242,7 @@ "ex/HEAD/cat-file.html#git_tree_entry_byindex-42" ], "general.c": [ - "ex/HEAD/general.html#git_tree_entry_byindex-79" + "ex/HEAD/general.html#git_tree_entry_byindex-81" ] } }, @@ -23094,8 +23380,8 @@ "ex/HEAD/cat-file.html#git_tree_entry_name-43" ], "general.c": [ - "ex/HEAD/general.html#git_tree_entry_name-80", - "ex/HEAD/general.html#git_tree_entry_name-81" + "ex/HEAD/general.html#git_tree_entry_name-82", + "ex/HEAD/general.html#git_tree_entry_name-83" ] } }, @@ -23262,7 +23548,7 @@ "group": "tree", "examples": { "general.c": [ - "ex/HEAD/general.html#git_tree_entry_to_object-82" + "ex/HEAD/general.html#git_tree_entry_to_object-84" ] } }, @@ -23582,6 +23868,48 @@ "description": "

Create an in-memory copy of a tree. The copy must be explicitly\n free'd or it will leak.

\n", "comments": "", "group": "tree" + }, + "git_tree_create_updated": { + "type": "function", + "file": "tree.h", + "line": 465, + "lineto": 465, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "id of the new tree" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to create the tree, must be the\n same as for `baseline`" + }, + { + "name": "baseline", + "type": "git_tree *", + "comment": "the tree to base these changes on" + }, + { + "name": "nupdates", + "type": "size_t", + "comment": "the number of elements in the update list" + }, + { + "name": "updates", + "type": "const git_tree_update *", + "comment": "the list of updates to perform" + } + ], + "argline": "git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates", + "sig": "git_oid *::git_repository *::git_tree *::size_t::const git_tree_update *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a tree based on another one with the specified modifications

\n", + "comments": "

Given the baseline perform the changes described in the list of updates and create a new tree.

\n\n

This function is optimized for common file/directory addition, removal and replacement in trees. It is much more efficient than reading the tree into a git_index and modifying that, but in exchange it is not as flexible.

\n\n

Deleting and adding the same entry is undefined behaviour, changing a tree to a blob or viceversa is not supported.

\n", + "group": "tree" } }, "callbacks": { @@ -23773,8 +24101,8 @@ "git_diff_notify_cb": { "type": "callback", "file": "diff.h", - "line": 347, - "lineto": 351, + "line": 353, + "lineto": 357, "args": [ { "name": "diff_so_far", @@ -23809,8 +24137,8 @@ "git_diff_progress_cb": { "type": "callback", "file": "diff.h", - "line": 363, - "lineto": 367, + "line": 369, + "lineto": 373, "args": [ { "name": "diff_so_far", @@ -23845,8 +24173,8 @@ "git_diff_file_cb": { "type": "callback", "file": "diff.h", - "line": 446, - "lineto": 449, + "line": 452, + "lineto": 455, "args": [ { "name": "delta", @@ -23876,8 +24204,8 @@ "git_diff_binary_cb": { "type": "callback", "file": "diff.h", - "line": 493, - "lineto": 496, + "line": 509, + "lineto": 512, "args": [ { "name": "delta", @@ -23907,8 +24235,8 @@ "git_diff_hunk_cb": { "type": "callback", "file": "diff.h", - "line": 513, - "lineto": 516, + "line": 529, + "lineto": 532, "args": [ { "name": "delta", @@ -23938,8 +24266,8 @@ "git_diff_line_cb": { "type": "callback", "file": "diff.h", - "line": 566, - "lineto": 570, + "line": 582, + "lineto": 586, "args": [ { "name": "delta", @@ -24098,12 +24426,12 @@ }, { "name": "current", - "type": "unsigned int", + "type": "uint32_t", "comment": null }, { "name": "total", - "type": "unsigned int", + "type": "uint32_t", "comment": null }, { @@ -24112,8 +24440,8 @@ "comment": null } ], - "argline": "int stage, unsigned int current, unsigned int total, void *payload", - "sig": "int::unsigned int::unsigned int::void *", + "argline": "int stage, uint32_t current, uint32_t total, void *payload", + "sig": "int::uint32_t::uint32_t::void *", "return": { "type": "int", "comment": null @@ -24217,8 +24545,8 @@ "git_revwalk_hide_cb": { "type": "callback", "file": "revwalk.h", - "line": 279, - "lineto": 281, + "line": 277, + "lineto": 279, "args": [ { "name": "commit_id", @@ -25154,7 +25482,6 @@ "used": { "returns": [], "needs": [ - "git_blob_create_fromchunks", "git_blob_dup", "git_blob_filtered_content", "git_blob_free", @@ -25301,6 +25628,7 @@ "git_diff_commit_as_email", "git_diff_format_email", "git_diff_stats_to_buf", + "git_diff_to_buf", "git_filter_apply_fn", "git_filter_list_apply_to_blob", "git_filter_list_apply_to_data", @@ -27218,6 +27546,7 @@ "git_diff_format_email", "git_diff_format_email_init_options", "git_diff_free", + "git_diff_from_buffer", "git_diff_get_delta", "git_diff_get_perfdata", "git_diff_get_stats", @@ -27240,6 +27569,7 @@ "git_diff_stats_free", "git_diff_stats_insertions", "git_diff_stats_to_buf", + "git_diff_to_buf", "git_diff_tree_to_index", "git_diff_tree_to_tree", "git_diff_tree_to_workdir", @@ -27261,19 +27591,25 @@ "git_diff_binary", { "decl": [ + "unsigned int contains_data", "git_diff_binary_file old_file", "git_diff_binary_file new_file" ], "type": "struct", "value": "git_diff_binary", "file": "diff.h", - "line": 484, - "lineto": 487, - "block": "git_diff_binary_file old_file\ngit_diff_binary_file new_file", + "line": 492, + "lineto": 503, + "block": "unsigned int contains_data\ngit_diff_binary_file old_file\ngit_diff_binary_file new_file", "tdef": "typedef", "description": " Structure describing the binary contents of a diff. ", "comments": "", "fields": [ + { + "type": "unsigned int", + "name": "contains_data", + "comments": " Whether there is data in this binary structure or not. If this\n is `1`, then this was produced and included binary content. If\n this is `0` then this was generated knowing only that a binary\n file changed but without providing the data, probably from a patch\n that said `Binary files a/file.txt and b/file.txt differ`." + }, { "type": "git_diff_binary_file", "name": "old_file", @@ -27309,8 +27645,8 @@ "type": "struct", "value": "git_diff_binary_file", "file": "diff.h", - "line": 469, - "lineto": 481, + "line": 477, + "lineto": 489, "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", "tdef": "typedef", "description": " The contents of one of the files in a binary diff. ", @@ -27353,8 +27689,8 @@ ], "type": "enum", "file": "diff.h", - "line": 457, - "lineto": 466, + "line": 465, + "lineto": 474, "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", "tdef": "typedef", "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", @@ -27399,8 +27735,8 @@ "type": "struct", "value": "git_diff_delta", "file": "diff.h", - "line": 325, - "lineto": 332, + "line": 331, + "lineto": 338, "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", "tdef": "typedef", "description": " Description of changes to one entry.", @@ -27463,17 +27799,18 @@ "const char * path", "git_off_t size", "uint32_t flags", - "uint16_t mode" + "uint16_t mode", + "uint16_t id_abbrev" ], "type": "struct", "value": "git_diff_file", "file": "diff.h", - "line": 281, - "lineto": 287, - "block": "git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode", + "line": 286, + "lineto": 293, + "block": "git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode\nuint16_t id_abbrev", "tdef": "typedef", "description": " Description of one side of a delta.", - "comments": "

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

\n\n

The oid is the git_oid of the item. If the entry represents an absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta), then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will be restricted to one of the git_filemode_t values.

\n", + "comments": "

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

\n\n

The id is the git_oid of the item. If the entry represents an absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta), then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will be restricted to one of the git_filemode_t values.

\n\n

The id_abbrev represents the known length of the id field, when converted to a hex string. It is generally GIT_OID_HEXSZ, unless this delta was created from reading a patch file, in which case it may be abbreviated to something reasonable, like 7 characters.

\n", "fields": [ { "type": "git_oid", @@ -27499,6 +27836,11 @@ "type": "uint16_t", "name": "mode", "comments": "" + }, + { + "type": "uint16_t", + "name": "id_abbrev", + "comments": "" } ], "used": { @@ -27529,8 +27871,8 @@ "type": "struct", "value": "git_diff_find_options", "file": "diff.h", - "line": 681, - "lineto": 707, + "line": 697, + "lineto": 723, "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", "tdef": "typedef", "description": " Control behavior of rename and copy detection", @@ -27609,8 +27951,8 @@ ], "type": "enum", "file": "diff.h", - "line": 575, - "lineto": 644, + "line": 591, + "lineto": 660, "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", "tdef": "typedef", "description": " Flags to control the behavior of diff rename/copy detection.", @@ -27777,8 +28119,8 @@ ], "type": "enum", "file": "diff.h", - "line": 1260, - "lineto": 1267, + "line": 1315, + "lineto": 1322, "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", "tdef": "typedef", "description": " Formatting options for diff e-mail generation", @@ -27821,8 +28163,8 @@ "type": "struct", "value": "git_diff_format_email_options", "file": "diff.h", - "line": 1272, - "lineto": 1294, + "line": 1327, + "lineto": 1349, "block": "unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst char * body\nconst git_signature * author", "tdef": "typedef", "description": " Options for controlling the formatting of the generated e-mail.", @@ -27890,8 +28232,8 @@ ], "type": "enum", "file": "diff.h", - "line": 1023, - "lineto": 1029, + "line": 1039, + "lineto": 1045, "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS", "tdef": "typedef", "description": " Possible output formats for diff data", @@ -27931,7 +28273,8 @@ "used": { "returns": [], "needs": [ - "git_diff_print" + "git_diff_print", + "git_diff_to_buf" ] } } @@ -27950,8 +28293,8 @@ "type": "struct", "value": "git_diff_hunk", "file": "diff.h", - "line": 501, - "lineto": 508, + "line": 517, + "lineto": 524, "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", "tdef": "typedef", "description": " Structure describing a hunk of a diff.", @@ -27960,32 +28303,32 @@ { "type": "int", "name": "old_start", - "comments": " Starting line number in old_file " + "comments": "" }, { "type": "int", "name": "old_lines", - "comments": " Number of lines in old_file " + "comments": " Starting line number in old_file " }, { "type": "int", "name": "new_start", - "comments": " Starting line number in new_file " + "comments": " Number of lines in old_file " }, { "type": "int", "name": "new_lines", - "comments": " Number of lines in new_file " + "comments": " Starting line number in new_file " }, { "type": "size_t", "name": "header_len", - "comments": " Number of bytes in header text " + "comments": " Number of lines in new_file " }, { "type": "char [128]", "name": "header", - "comments": " Header text, NUL-byte terminated " + "comments": " Number of bytes in header text " } ], "used": { @@ -28019,8 +28362,8 @@ "type": "struct", "value": "git_diff_line", "file": "diff.h", - "line": 548, - "lineto": 556, + "line": 564, + "lineto": 572, "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", "tdef": "typedef", "description": " Structure describing a line (or data span) of a diff.", @@ -28095,8 +28438,8 @@ ], "type": "enum", "file": "diff.h", - "line": 527, - "lineto": 543, + "line": 543, + "lineto": 559, "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY", "tdef": "typedef", "description": " Line origin constants.", @@ -28408,8 +28751,8 @@ "type": "struct", "value": "git_diff_options", "file": "diff.h", - "line": 396, - "lineto": 416, + "line": 402, + "lineto": 422, "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\ngit_diff_progress_cb progress_cb\nvoid * payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", "tdef": "typedef", "description": " Structure describing options about how the diff should be executed.", @@ -28502,6 +28845,49 @@ } } ], + [ + "git_diff_perfdata", + { + "decl": [ + "unsigned int version", + "size_t stat_calls", + "size_t oid_calculations" + ], + "type": "struct", + "value": "git_diff_perfdata", + "file": "sys/diff.h", + "line": 67, + "lineto": 71, + "block": "unsigned int version\nsize_t stat_calls\nsize_t oid_calculations", + "tdef": "typedef", + "description": " Performance data from diffing", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "size_t", + "name": "stat_calls", + "comments": " Number of stat() calls performed " + }, + { + "type": "size_t", + "name": "oid_calculations", + "comments": " Number of ID calculations " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_get_perfdata", + "git_status_list_get_perfdata" + ] + } + } + ], [ "git_diff_similarity_metric", { @@ -28515,8 +28901,8 @@ "type": "struct", "value": "git_diff_similarity_metric", "file": "diff.h", - "line": 649, - "lineto": 659, + "line": 665, + "lineto": 675, "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", "tdef": "typedef", "description": " Pluggable similarity metric", @@ -28561,8 +28947,8 @@ "type": "struct", "value": "git_diff_stats", "file": "diff.h", - "line": 1174, - "lineto": 1174, + "line": 1229, + "lineto": 1229, "tdef": "typedef", "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", "comments": "", @@ -28591,8 +28977,8 @@ ], "type": "enum", "file": "diff.h", - "line": 1179, - "lineto": 1194, + "line": 1234, + "lineto": 1249, "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", "tdef": "typedef", "description": " Formatting options for diff stats", @@ -28949,13 +29335,14 @@ "GITERR_CHERRYPICK", "GITERR_DESCRIBE", "GITERR_REBASE", - "GITERR_FILESYSTEM" + "GITERR_FILESYSTEM", + "GITERR_PATCH" ], "type": "enum", "file": "errors.h", "line": 70, - "lineto": 102, - "block": "GITERR_NONE\nGITERR_NOMEMORY\nGITERR_OS\nGITERR_INVALID\nGITERR_REFERENCE\nGITERR_ZLIB\nGITERR_REPOSITORY\nGITERR_CONFIG\nGITERR_REGEX\nGITERR_ODB\nGITERR_INDEX\nGITERR_OBJECT\nGITERR_NET\nGITERR_TAG\nGITERR_TREE\nGITERR_INDEXER\nGITERR_SSL\nGITERR_SUBMODULE\nGITERR_THREAD\nGITERR_STASH\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM", + "lineto": 103, + "block": "GITERR_NONE\nGITERR_NOMEMORY\nGITERR_OS\nGITERR_INVALID\nGITERR_REFERENCE\nGITERR_ZLIB\nGITERR_REPOSITORY\nGITERR_CONFIG\nGITERR_REGEX\nGITERR_ODB\nGITERR_INDEX\nGITERR_OBJECT\nGITERR_NET\nGITERR_TAG\nGITERR_TREE\nGITERR_INDEXER\nGITERR_SSL\nGITERR_SUBMODULE\nGITERR_THREAD\nGITERR_STASH\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM\nGITERR_PATCH", "tdef": "typedef", "description": " Error classes ", "comments": "", @@ -29145,6 +29532,12 @@ "name": "GITERR_FILESYSTEM", "comments": "", "value": 30 + }, + { + "type": "int", + "name": "GITERR_PATCH", + "comments": "", + "value": 31 } ], "used": { @@ -29417,6 +29810,7 @@ "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", + "git_filter_list_length", "git_filter_list_load", "git_filter_list_new", "git_filter_list_push", @@ -29490,6 +29884,7 @@ "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", + "git_filter_list_length", "git_filter_list_load", "git_filter_list_new", "git_filter_list_push", @@ -29597,6 +29992,7 @@ "returns": [], "needs": [ "git_hashsig_compare", + "git_hashsig_create", "git_hashsig_create_fromfile", "git_hashsig_free" ] @@ -29649,6 +30045,7 @@ "used": { "returns": [], "needs": [ + "git_hashsig_create", "git_hashsig_create_fromfile" ] } @@ -29830,7 +30227,9 @@ "git_index_remove_bypath", "git_index_remove_directory", "git_index_set_caps", + "git_index_set_version", "git_index_update_all", + "git_index_version", "git_index_write", "git_index_write_tree", "git_index_write_tree_to", @@ -30165,13 +30564,14 @@ "GIT_OPT_SET_SSL_CERT_LOCATIONS", "GIT_OPT_SET_USER_AGENT", "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", - "GIT_OPT_SET_SSL_CIPHERS" + "GIT_OPT_SET_SSL_CIPHERS", + "GIT_OPT_GET_USER_AGENT" ], "type": "enum", "file": "common.h", "line": 144, - "lineto": 161, - "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_SET_SSL_CIPHERS", + "lineto": 162, + "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_SET_SSL_CIPHERS\nGIT_OPT_GET_USER_AGENT", "tdef": "typedef", "description": " Global library options", "comments": "

These are used to select which global option to set or get and are used in git_libgit2_opts().

\n", @@ -30271,6 +30671,12 @@ "name": "GIT_OPT_SET_SSL_CIPHERS", "comments": "", "value": 15 + }, + { + "type": "int", + "name": "GIT_OPT_GET_USER_AGENT", + "comments": "", + "value": 16 } ], "used": { @@ -31066,7 +31472,7 @@ "file": "types.h", "line": 84, "lineto": 84, - "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, int *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, int *, git_otype *, git_odb_backend *, const git_oid *, int) read_prefix\nint (*)(int *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, int, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, int) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nvoid (*)(git_odb_backend *) free", + "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nint (*)(git_odb_backend *, const git_oid *) freshen\nvoid (*)(git_odb_backend *) free", "tdef": "typedef", "description": " A custom backend in an ODB ", "comments": "", @@ -31082,22 +31488,22 @@ "comments": "" }, { - "type": "int (*)(void **, int *, git_otype *, git_odb_backend *, const git_oid *)", + "type": "int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)", "name": "read", "comments": "" }, { - "type": "int (*)(git_oid *, void **, int *, git_otype *, git_odb_backend *, const git_oid *, int)", + "type": "int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)", "name": "read_prefix", "comments": "" }, { - "type": "int (*)(int *, git_otype *, git_odb_backend *, const git_oid *)", + "type": "int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)", "name": "read_header", "comments": "" }, { - "type": "int (*)(git_odb_backend *, const git_oid *, const void *, int, git_otype)", + "type": "int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)", "name": "write", "comments": " Write an object into the backend. The id of the object has\n already been calculated and is passed in." }, @@ -31117,7 +31523,7 @@ "comments": "" }, { - "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, int)", + "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)", "name": "exists_prefix", "comments": "" }, @@ -31136,6 +31542,11 @@ "name": "writepack", "comments": "" }, + { + "type": "int (*)(git_odb_backend *, const git_oid *)", + "name": "freshen", + "comments": " \"Freshens\" an already existing object, updating its last-used\n time. This occurs when `git_odb_write` was called, but the\n object already existed (and will not be re-written). The\n underlying implementation may want to update last-used timestamps.\n\n If callers implement this, they should return `0` if the object\n exists and was freshened, and non-zero otherwise." + }, { "type": "void (*)(git_odb_backend *)", "name": "free", @@ -31438,7 +31849,6 @@ "git_annotated_commit_from_fetchhead", "git_annotated_commit_lookup", "git_blob_create_frombuffer", - "git_blob_create_fromchunks", "git_blob_create_fromdisk", "git_blob_create_fromstream_commit", "git_blob_create_fromworkdir", @@ -31447,6 +31857,7 @@ "git_commit_amend", "git_commit_create", "git_commit_create_from_callback", + "git_commit_create_from_ids", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_extract_signature", @@ -31521,6 +31932,7 @@ "git_tag_create_lightweight", "git_tag_lookup", "git_tag_lookup_prefix", + "git_tree_create_updated", "git_tree_entry_byid", "git_tree_lookup", "git_tree_lookup_prefix", @@ -32527,6 +32939,7 @@ "git_reference_create", "git_reference_create_matching", "git_reference_delete", + "git_reference_dup", "git_reference_dwim", "git_reference_foreach", "git_reference_foreach_glob", @@ -32620,8 +33033,8 @@ ], "type": "enum", "file": "refs.h", - "line": 625, - "lineto": 654, + "line": 636, + "lineto": 665, "block": "GIT_REF_FORMAT_NORMAL\nGIT_REF_FORMAT_ALLOW_ONELEVEL\nGIT_REF_FORMAT_REFSPEC_PATTERN\nGIT_REF_FORMAT_REFSPEC_SHORTHAND", "tdef": "typedef", "description": " Normalization options for reference lookup", @@ -33069,7 +33482,6 @@ "git_attr_get_many", "git_blame_file", "git_blob_create_frombuffer", - "git_blob_create_fromchunks", "git_blob_create_fromdisk", "git_blob_create_fromstream", "git_blob_create_fromworkdir", @@ -33088,6 +33500,7 @@ "git_commit_create", "git_commit_create_buffer", "git_commit_create_from_callback", + "git_commit_create_from_ids", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_extract_signature", @@ -33254,6 +33667,7 @@ "git_tag_list_match", "git_tag_lookup", "git_tag_lookup_prefix", + "git_tree_create_updated", "git_tree_entry_to_object", "git_tree_lookup", "git_tree_lookup_prefix", @@ -33276,8 +33690,8 @@ ], "type": "enum", "file": "repository.h", - "line": 202, - "lineto": 210, + "line": 221, + "lineto": 229, "block": "GIT_REPOSITORY_INIT_BARE\nGIT_REPOSITORY_INIT_NO_REINIT\nGIT_REPOSITORY_INIT_NO_DOTGIT_DIR\nGIT_REPOSITORY_INIT_MKDIR\nGIT_REPOSITORY_INIT_MKPATH\nGIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK", "tdef": "typedef", "description": " Option flags for `git_repository_init_ext`.", @@ -33342,8 +33756,8 @@ ], "type": "enum", "file": "repository.h", - "line": 225, - "lineto": 229, + "line": 244, + "lineto": 248, "block": "GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL", "tdef": "typedef", "description": " Mode options for `git_repository_init_ext`.", @@ -33390,8 +33804,8 @@ "type": "struct", "value": "git_repository_init_options", "file": "repository.h", - "line": 259, - "lineto": 268, + "line": 278, + "lineto": 287, "block": "unsigned int version\nuint32_t flags\nuint32_t mode\nconst char * workdir_path\nconst char * description\nconst char * template_path\nconst char * initial_head\nconst char * origin_url", "tdef": "typedef", "description": " Extended options structure for `git_repository_init_ext`.", @@ -33453,16 +33867,18 @@ "decl": [ "GIT_REPOSITORY_OPEN_NO_SEARCH", "GIT_REPOSITORY_OPEN_CROSS_FS", - "GIT_REPOSITORY_OPEN_BARE" + "GIT_REPOSITORY_OPEN_BARE", + "GIT_REPOSITORY_OPEN_NO_DOTGIT", + "GIT_REPOSITORY_OPEN_FROM_ENV" ], "type": "enum", "file": "repository.h", - "line": 99, - "lineto": 103, - "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE", + "line": 115, + "lineto": 121, + "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE\nGIT_REPOSITORY_OPEN_NO_DOTGIT\nGIT_REPOSITORY_OPEN_FROM_ENV", "tdef": "typedef", "description": " Option flags for `git_repository_open_ext`.", - "comments": "
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be immediately found in the start_path. Do not walk up from the start_path looking at parent directories. * GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not continue searching across filesystem boundaries (i.e. when st_dev changes from the stat system call). (E.g. Searching in a user's home directory "/home/user/source/" will not return "/.git/" as the found repo if "/" is a different filesystem than "/home".) * GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless of core.bare config, and defer loading config file for faster setup. Unlike git_repository_open_bare, this can follow gitlinks.
  • \n
\n", + "comments": "
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be immediately found in the start_path. Do not walk up from the start_path looking at parent directories. * GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not continue searching across filesystem boundaries (i.e. when st_dev changes from the stat system call). (E.g. Searching in a user's home directory "/home/user/source/" will not return "/.git/" as the found repo if "/" is a different filesystem than "/home".) * GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless of core.bare config, and defer loading config file for faster setup. Unlike git_repository_open_bare, this can follow gitlinks. * GIT_REPOSITORY_OPEN_NO_DOTGIT - Do not check for a repository by appending /.git to the start_path; only open the repository if start_path itself points to the git directory. * GIT_REPOSITORY_OPEN_FROM_ENV - Find and open a git repository, respecting the environment variables used by the git command-line tools. If set, git_repository_open_ext will ignore the other flags and the ceiling_dirs argument, and will allow a NULL path to use GIT_DIR or search from the current directory. The search for a repository will respect $GIT_CEILING_DIRECTORIES and $GIT_DISCOVERY_ACROSS_FILESYSTEM. The opened repository will respect $GIT_INDEX_FILE, $GIT_NAMESPACE, $GIT_OBJECT_DIRECTORY, and $GIT_ALTERNATE_OBJECT_DIRECTORIES. In the future, this flag will also cause git_repository_open_ext to respect $GIT_WORK_TREE and $GIT_COMMON_DIR; currently, git_repository_open_ext with this flag will error out if either $GIT_WORK_TREE or $GIT_COMMON_DIR is set.
  • \n
\n", "fields": [ { "type": "int", @@ -33481,6 +33897,18 @@ "name": "GIT_REPOSITORY_OPEN_BARE", "comments": "", "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_NO_DOTGIT", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_FROM_ENV", + "comments": "", + "value": 16 } ], "used": { @@ -33508,8 +33936,8 @@ ], "type": "enum", "file": "repository.h", - "line": 674, - "lineto": 687, + "line": 693, + "lineto": 706, "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_REVERT_SEQUENCE\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", "tdef": "typedef", "description": " Repository state", @@ -33857,6 +34285,7 @@ "git_commit_create", "git_commit_create_buffer", "git_commit_create_from_callback", + "git_commit_create_from_ids", "git_commit_create_v", "git_note_create", "git_note_remove", @@ -33866,6 +34295,7 @@ "git_signature_default", "git_signature_dup", "git_signature_free", + "git_signature_from_buffer", "git_signature_new", "git_signature_now", "git_tag_annotation_create", @@ -33926,7 +34356,7 @@ "type": "enum", "file": "revwalk.h", "line": 26, - "lineto": 55, + "lineto": 53, "block": "GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE", "tdef": "typedef", "description": " Flags to specify the sorting which a revwalk should perform.", @@ -33935,13 +34365,13 @@ { "type": "int", "name": "GIT_SORT_NONE", - "comments": "

Sort the repository contents in no particular ordering;\n this sorting is arbitrary, implementation-specific\n and subject to change at any time.\n This is the default sorting for new walkers.

\n", + "comments": "

Sort the output with the same default time-order method from git.\n This is the default sorting for new walkers.

\n", "value": 0 }, { "type": "int", "name": "GIT_SORT_TOPOLOGICAL", - "comments": "

Sort the repository contents in topological order\n (parents before children); this sorting mode\n can be combined with time sorting.

\n", + "comments": "

Sort the repository contents in topological order (parents before\n children); this sorting mode can be combined with time sorting to\n produce git's "time-order".

\n", "value": 1 }, { @@ -34429,8 +34859,8 @@ "int (*)(struct git_stream *) connect", "int (*)(git_cert **, struct git_stream *) certificate", "int (*)(struct git_stream *, const int *) set_proxy", - "ssize_t (*)(struct git_stream *, void *, int) read", - "ssize_t (*)(struct git_stream *, const char *, int, int) write", + "ssize_t (*)(struct git_stream *, void *, size_t) read", + "ssize_t (*)(struct git_stream *, const char *, size_t, int) write", "int (*)(struct git_stream *) close", "void (*)(struct git_stream *) free" ], @@ -34439,7 +34869,7 @@ "file": "sys/stream.h", "line": 29, "lineto": 41, - "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const int *) set_proxy\nssize_t (*)(struct git_stream *, void *, int) read\nssize_t (*)(struct git_stream *, const char *, int, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", + "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const int *) set_proxy\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", "tdef": "typedef", "description": " Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as", "comments": "
 struct my_stream {             git_stream parent;             ...     }\n
\n\n

and fill the functions

\n", @@ -34475,12 +34905,12 @@ "comments": "" }, { - "type": "ssize_t (*)(struct git_stream *, void *, int)", + "type": "ssize_t (*)(struct git_stream *, void *, size_t)", "name": "read", "comments": "" }, { - "type": "ssize_t (*)(struct git_stream *, const char *, int, int)", + "type": "ssize_t (*)(struct git_stream *, const char *, size_t, int)", "name": "write", "comments": "" }, @@ -34789,14 +35219,15 @@ "unsigned int version", "git_checkout_options checkout_opts", "git_fetch_options fetch_opts", - "unsigned int clone_checkout_strategy" + "unsigned int clone_checkout_strategy", + "int allow_fetch" ], "type": "struct", "value": "git_submodule_update_options", "file": "submodule.h", "line": 129, - "lineto": 157, - "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nunsigned int clone_checkout_strategy", + "lineto": 163, + "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nunsigned int clone_checkout_strategy\nint allow_fetch", "tdef": "typedef", "description": " Submodule update options structure", "comments": "

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings, like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n", @@ -34820,6 +35251,11 @@ "type": "unsigned int", "name": "clone_checkout_strategy", "comments": " The checkout strategy to use when the sub repository needs to\n be cloned. Use GIT_CHECKOUT_SAFE to create all files\n in the working directory for the newly cloned repository." + }, + { + "type": "int", + "name": "allow_fetch", + "comments": " Allow fetching from the submodule's default remote if the target\n commit isn't found. Enabled by default." } ], "used": { @@ -35218,6 +35654,7 @@ "git_index_read_tree", "git_merge_trees", "git_pathspec_match_tree", + "git_tree_create_updated", "git_tree_dup", "git_tree_entry_byid", "git_tree_entry_byindex", @@ -35291,6 +35728,89 @@ } } ], + [ + "git_tree_update", + { + "decl": [ + "git_tree_update_t action", + "git_oid id", + "git_filemode_t filemode", + "const char * path" + ], + "type": "struct", + "value": "git_tree_update", + "file": "tree.h", + "line": 434, + "lineto": 443, + "block": "git_tree_update_t action\ngit_oid id\ngit_filemode_t filemode\nconst char * path", + "tdef": "typedef", + "description": " An action to perform during the update of a tree", + "comments": "", + "fields": [ + { + "type": "git_tree_update_t", + "name": "action", + "comments": " Update action. If it's an removal, only the path is looked at " + }, + { + "type": "git_oid", + "name": "id", + "comments": " The entry's id " + }, + { + "type": "git_filemode_t", + "name": "filemode", + "comments": " The filemode/kind of object " + }, + { + "type": "const char *", + "name": "path", + "comments": " The full path from the root tree " + } + ], + "used": { + "returns": [], + "needs": [ + "git_tree_create_updated" + ] + } + } + ], + [ + "git_tree_update_t", + { + "decl": [ + "GIT_TREE_UPDATE_UPSERT", + "GIT_TREE_UPDATE_REMOVE" + ], + "type": "enum", + "file": "tree.h", + "line": 424, + "lineto": 429, + "block": "GIT_TREE_UPDATE_UPSERT\nGIT_TREE_UPDATE_REMOVE", + "tdef": "typedef", + "description": " The kind of update to perform", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_TREE_UPDATE_UPSERT", + "comments": "

Update or insert an entry at the specified path

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_TREE_UPDATE_REMOVE", + "comments": "

Remove an entry from the specified path

\n", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], [ "git_treebuilder", { @@ -35421,7 +35941,6 @@ "blob", [ "git_blob_create_frombuffer", - "git_blob_create_fromchunks", "git_blob_create_fromdisk", "git_blob_create_fromstream", "git_blob_create_fromstream_commit", @@ -35499,6 +36018,7 @@ "git_commit_create", "git_commit_create_buffer", "git_commit_create_from_callback", + "git_commit_create_from_ids", "git_commit_create_v", "git_commit_create_with_signature", "git_commit_dup", @@ -35612,6 +36132,7 @@ "git_diff_format_email", "git_diff_format_email_init_options", "git_diff_free", + "git_diff_from_buffer", "git_diff_get_delta", "git_diff_get_perfdata", "git_diff_get_stats", @@ -35631,6 +36152,7 @@ "git_diff_stats_insertions", "git_diff_stats_to_buf", "git_diff_status_char", + "git_diff_to_buf", "git_diff_tree_to_index", "git_diff_tree_to_tree", "git_diff_tree_to_workdir", @@ -35651,6 +36173,7 @@ "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", + "git_filter_list_length", "git_filter_list_load", "git_filter_list_new", "git_filter_list_push", @@ -35688,6 +36211,7 @@ "hashsig", [ "git_hashsig_compare", + "git_hashsig_create", "git_hashsig_create_fromfile", "git_hashsig_free" ] @@ -35737,7 +36261,9 @@ "git_index_remove_bypath", "git_index_remove_directory", "git_index_set_caps", + "git_index_set_version", "git_index_update_all", + "git_index_version", "git_index_write", "git_index_write_tree", "git_index_write_tree_to" @@ -36015,6 +36541,7 @@ "git_reference_create", "git_reference_create_matching", "git_reference_delete", + "git_reference_dup", "git_reference_dwim", "git_reference_ensure_log", "git_reference_foreach", @@ -36232,6 +36759,7 @@ "git_signature_default", "git_signature_dup", "git_signature_free", + "git_signature_from_buffer", "git_signature_new", "git_signature_now" ] @@ -36345,6 +36873,12 @@ "git_tag_target_type" ] ], + [ + "time", + [ + "git_time_monotonic" + ] + ], [ "trace", [ @@ -36367,6 +36901,7 @@ [ "tree", [ + "git_tree_create_updated", "git_tree_dup", "git_tree_entry_byid", "git_tree_entry_byindex", From 3c1c3958d96dcc5439399495f2d262a91b371a93 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Tue, 10 Jan 2017 13:09:11 -0700 Subject: [PATCH 37/53] Update libgit2 gyp file to reflect added / removed files --- vendor/libgit2.gyp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 37c19fd72..b36467004 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -30,9 +30,12 @@ "sources": [ "libgit2/include/git2/sys/hashsig.h", "libgit2/include/git2/sys/merge.h", + "libgit2/include/git2/sys/time.h", "libgit2/src/annotated_commit.c", "libgit2/src/annotated_commit.h", "libgit2/src/array.h", + "libgit2/src/apply.c", + "libgit2/src/apply.h", "libgit2/src/attr_file.c", "libgit2/src/attr_file.h", "libgit2/src/attr.c", @@ -73,19 +76,20 @@ "libgit2/src/config.h", "libgit2/src/crlf.c", "libgit2/src/date.c", - "libgit2/src/delta-apply.c", - "libgit2/src/delta-apply.h", "libgit2/src/delta.c", "libgit2/src/delta.h", "libgit2/src/diff_driver.c", "libgit2/src/diff_driver.h", "libgit2/src/diff_file.c", "libgit2/src/diff_file.h", - "libgit2/src/diff_patch.c", - "libgit2/src/diff_patch.h", + "libgit2/src/diff_generate.c", + "libgit2/src/diff_generate.h", + "libgit2/src/diff_parse.c", + "libgit2/src/diff_parse.h", "libgit2/src/diff_print.c", "libgit2/src/diff_stats.c", "libgit2/src/diff_tform.c", + "libgit2/src/diff_tform.h", "libgit2/src/diff_xdiff.c", "libgit2/src/diff_xdiff.h", "libgit2/src/diff.c", @@ -157,6 +161,12 @@ "libgit2/src/pack.h", "libgit2/src/path.c", "libgit2/src/path.h", + "libgit2/src/patch.c", + "libgit2/src/patch.h", + "libgit2/src/patch_generate.c", + "libgit2/src/patch_generate.h", + "libgit2/src/patch_parse.c", + "libgit2/src/patch_parse.h", "libgit2/src/pathspec.c", "libgit2/src/pathspec.h", "libgit2/src/pool.c", @@ -236,6 +246,8 @@ "libgit2/src/userdiff.h", "libgit2/src/util.c", "libgit2/src/util.h", + "libgit2/src/varint.c", + "libgit2/src/varint.h", "libgit2/src/vector.c", "libgit2/src/vector.h", "libgit2/src/xdiff/xdiff.h", @@ -354,8 +366,8 @@ "libgit2/src/win32/posix.h", "libgit2/src/win32/precompiled.c", "libgit2/src/win32/precompiled.h", - "libgit2/src/win32/pthread.c", - "libgit2/src/win32/pthread.h", + "libgit2/src/win32/thread.c", + "libgit2/src/win32/thread.h", "libgit2/src/win32/reparse.h", "libgit2/src/win32/utf-conv.c", "libgit2/src/win32/utf-conv.h", @@ -372,6 +384,7 @@ "sources": [ "libgit2/src/unix/map.c", "libgit2/src/unix/posix.h", + "libgit2/src/unix/pthread.h", "libgit2/src/unix/realpath.c", ], "cflags": [ From 1e36594b3cb1e859f2b7af8e8939a7b7f0fbbcd7 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Tue, 10 Jan 2017 13:23:51 -0700 Subject: [PATCH 38/53] Include time.h for time --- generate/input/descriptor.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index bc628cb3d..a9264214a 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -2456,7 +2456,11 @@ } }, "time": { - "dupFunction": "git_time_dup" + "dupFunction": "git_time_dup", + "dependencies": [ + "git2/sys/time.h" + ] + }, "trace": { "functions": { From ebd1f460638cb4a3715c70b8951b0f37ce37551f Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Tue, 10 Jan 2017 13:24:21 -0700 Subject: [PATCH 39/53] Add cType mapping for double --- generate/scripts/helpers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate/scripts/helpers.js b/generate/scripts/helpers.js index f3bd3772f..48b651355 100644 --- a/generate/scripts/helpers.js +++ b/generate/scripts/helpers.js @@ -22,7 +22,8 @@ var cTypeMappings = { "size_t": "Number", "uint16_t": "Number", "uint32_t": "Number", - "uint64_t": "Number" + "uint64_t": "Number", + "double": "Number" } var collisionMappings = { From 43e496820d0b115a0d77b561e4f2003f1d73dd25 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Tue, 24 Jan 2017 07:13:29 -0700 Subject: [PATCH 40/53] Bump libgit to 176f55 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 2fcb8705e..176f55527 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 2fcb8705e584ca61f6c4657525c9d2713f6a39d2 +Subproject commit 176f55527d00160ec9ef4816fec3a045c37890d8 From a5865b7d4845f740c50f2ca30ae69ff96e73b8b8 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Fri, 27 Jan 2017 14:14:33 -0700 Subject: [PATCH 41/53] Update expected error messages --- test/tests/rebase.js | 2 +- test/tests/remote.js | 9 ++------- test/tests/revparse.js | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/test/tests/rebase.js b/test/tests/rebase.js index f40d73621..70c8e8ee6 100644 --- a/test/tests/rebase.js +++ b/test/tests/rebase.js @@ -667,7 +667,7 @@ describe("Rebase", function() { "There should not be a rebase in progress"); }) .catch(function(e) { - assert.equal(e.message, "There is no rebase in progress"); + assert.equal(e.message, "there is no rebase in progress"); }); }) .then(function() { diff --git a/test/tests/remote.js b/test/tests/remote.js index 165cc8214..583618605 100644 --- a/test/tests/remote.js +++ b/test/tests/remote.js @@ -388,13 +388,8 @@ describe("Remote", function() { // catches linux / osx failure to use anonymous credentials // stops callback infinite loop .catch(function (reason) { - if (reason.message !== - "Method push has thrown an error.") - { - throw reason; - } else { - return Promise.resolve(); - } + assert.equal(reason.message.replace(/\n|\r/g, ""), + "failed to set credentials: The parameter is incorrect."); }); }); diff --git a/test/tests/revparse.js b/test/tests/revparse.js index a097b9a3e..84ed44ca8 100644 --- a/test/tests/revparse.js +++ b/test/tests/revparse.js @@ -37,7 +37,7 @@ describe("Revparse", function() { }) .catch(function(error) { assert.ok(error instanceof Error); - assert.equal(error.message, "Revspec 'INVALID' not found."); + assert.equal(error.message, "revspec 'INVALID' not found"); }); }); From 16bbb63022f9b4be7fb7f32aeaa414d8d26316fe Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 08:47:34 -0700 Subject: [PATCH 42/53] Fix notes can be removed test --- test/tests/note.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/tests/note.js b/test/tests/note.js index c240dcd09..47b8cffb6 100644 --- a/test/tests/note.js +++ b/test/tests/note.js @@ -58,12 +58,14 @@ describe("Note", function() { var noteRef = "refs/notes/commits"; var sig = Signature.create("John", "john@doe.com", Date.now(), 0); - return Note.remove(this.repository, noteRef, sig, sig, sha) + return Note.create(this.repository, noteRef, sig, sig, sha, "Testing!", 1) + .then((noteSha) => Note.remove(this.repository, noteRef, sig, sig, sha)) .then(function() { return Note.read(test.repository, noteRef, sha).catch(function(ex) { - assert.equal(ex.message, "Note could not be found"); + assert.equal(ex.message, "note could not be found"); done(); }); - }); + }) + .catch(done); }); }); From 185c6ca57dc5847f718de2f662783570ef48a085 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 10:15:58 -0700 Subject: [PATCH 43/53] Bump libgit to 39e76b --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 176f55527..39e76bb34 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 176f55527d00160ec9ef4816fec3a045c37890d8 +Subproject commit 39e76bb346760ad1183e8253186df3044752341e From 9c01821796dee6608aafd6cb7af4a0fbe1d83504 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 10:04:44 -0700 Subject: [PATCH 44/53] Add support for reverse callbacks to ThreadPool --- .../templates/manual/include/thread_pool.h | 37 ++++++-- generate/templates/manual/src/thread_pool.cc | 90 +++++++++++++------ 2 files changed, 93 insertions(+), 34 deletions(-) diff --git a/generate/templates/manual/include/thread_pool.h b/generate/templates/manual/include/thread_pool.h index 6d29b3ddf..bcb3590d7 100644 --- a/generate/templates/manual/include/thread_pool.h +++ b/generate/templates/manual/include/thread_pool.h @@ -8,11 +8,20 @@ class ThreadPool { typedef void (*Callback) (void *); struct Work { Callback workCallback; - Callback loopCallback; + Callback completionCallback; void *data; - Work(Callback workCallback, Callback loopCallback, void *data) - : workCallback(workCallback), loopCallback(loopCallback), data(data) { + Work(Callback workCallback, Callback completionCallback, void *data) + : workCallback(workCallback), completionCallback(completionCallback), data(data) { + } + }; + + struct ReverseCall { + Callback reverseCallback; + void *data; + + ReverseCall(Callback reverseCallback, void *data) + : reverseCallback(reverseCallback), data(data) { } }; @@ -23,14 +32,21 @@ class ThreadPool { int workInProgressCount; // completion callbacks to be performed on the loop - std::queue loopQueue; - uv_mutex_t loopMutex; - uv_async_t loopAsync; + std::queue completionQueue; + uv_mutex_t completionMutex; + uv_async_t completionAsync; + + // async callback made from the threadpool, executed in the loop + std::queue reverseQueue; + uv_mutex_t reverseMutex; + uv_async_t reverseAsync; static void RunEventQueue(void *threadPool); void RunEventQueue(); - static void RunLoopCallbacks(uv_async_t* handle); - void RunLoopCallbacks(); + static void RunCompletionCallbacks(uv_async_t* handle); + void RunCompletionCallbacks(); + static void RunReverseCallbacks(uv_async_t *handle); + void RunReverseCallbacks(); public: // Initializes thread pool and spins up the requested number of threads // The provided loop will be used for completion callbacks, whenever @@ -39,7 +55,10 @@ class ThreadPool { // Queues work on the thread pool, followed by completion call scheduled // on the loop provided in the constructor. // QueueWork should be called on the loop provided in the constructor. - void QueueWork(Callback workCallback, Callback loopCallback, void *data); + void QueueWork(Callback workCallback, Callback completionCallback, void *data); + // Queues a callback on the loop provided in the constructor + // these block the calling thread's execution until the callback completes + void ExecuteReverseCallback(Callback reverseCallback, void *data); }; #endif diff --git a/generate/templates/manual/src/thread_pool.cc b/generate/templates/manual/src/thread_pool.cc index abf7a29a8..c89da76a3 100644 --- a/generate/templates/manual/src/thread_pool.cc +++ b/generate/templates/manual/src/thread_pool.cc @@ -4,10 +4,14 @@ ThreadPool::ThreadPool(int numberOfThreads, uv_loop_t *loop) { uv_mutex_init(&workMutex); uv_sem_init(&workSemaphore, 0); - uv_async_init(loop, &loopAsync, RunLoopCallbacks); - loopAsync.data = this; - uv_unref((uv_handle_t *)&loopAsync); - uv_mutex_init(&loopMutex); + uv_async_init(loop, &completionAsync, RunCompletionCallbacks); + completionAsync.data = this; + uv_unref((uv_handle_t *)&completionAsync); + uv_mutex_init(&completionMutex); + + uv_async_init(loop, &reverseAsync, RunReverseCallbacks); + reverseAsync.data = this; + uv_mutex_init(&reverseMutex); workInProgressCount = 0; @@ -17,17 +21,31 @@ ThreadPool::ThreadPool(int numberOfThreads, uv_loop_t *loop) { } } -void ThreadPool::QueueWork(Callback workCallback, Callback loopCallback, void *data) { +void ThreadPool::QueueWork(Callback workCallback, Callback completionCallback, void *data) { uv_mutex_lock(&workMutex); // there is work on the thread pool - reference the handle so // node doesn't terminate - uv_ref((uv_handle_t *)&loopAsync); - workQueue.push(Work(workCallback, loopCallback, data)); + uv_ref((uv_handle_t *)&completionAsync); + workQueue.push(Work(workCallback, completionCallback, data)); workInProgressCount++; uv_mutex_unlock(&workMutex); uv_sem_post(&workSemaphore); } +void ThreadPool::ExecuteReverseCallback(Callback reverseCallback, void *data) { + // push the callback into the queue + uv_mutex_lock(&reverseMutex); + ReverseCall reverseCall(reverseCallback, data); + bool queueWasEmpty = reverseQueue.empty(); + reverseQueue.push(reverseCall); + // we only trigger RunReverseCallbacks via the reverseAsync handle if the queue + // was empty. Otherwise, we depend on RunReverseCallbacks to re-trigger itself + if (queueWasEmpty) { + uv_async_send(&reverseAsync); + } + uv_mutex_unlock(&reverseMutex); +} + void ThreadPool::RunEventQueue(void *threadPool) { static_cast(threadPool)->RunEventQueue(); } @@ -46,40 +64,62 @@ void ThreadPool::RunEventQueue() { (*work.workCallback)(work.data); // schedule the callback on the loop - uv_mutex_lock(&loopMutex); - loopQueue.push(work); - uv_mutex_unlock(&loopMutex); - uv_async_send(&loopAsync); + uv_mutex_lock(&completionMutex); + completionQueue.push(work); + uv_mutex_unlock(&completionMutex); + uv_async_send(&completionAsync); } } -void ThreadPool::RunLoopCallbacks(uv_async_t* handle) { - static_cast(handle->data)->RunLoopCallbacks(); +void ThreadPool::RunCompletionCallbacks(uv_async_t* handle) { + static_cast(handle->data)->RunCompletionCallbacks(); } -void ThreadPool::RunLoopCallbacks() { +void ThreadPool::RunCompletionCallbacks() { // uv_async_send can coalesce calls, so we are not guaranteed one - // RunLoopCallbacks per uv_async_send call - // so we always process the entire loopQueue + // RunCompletionCallbacks per uv_async_send call + // so we always process the entire completionQueue int callbacksCompleted = 0; - uv_mutex_lock(&loopMutex); - while(!loopQueue.empty()) { - Work work = loopQueue.front(); - loopQueue.pop(); - uv_mutex_unlock(&loopMutex); + uv_mutex_lock(&completionMutex); + while(!completionQueue.empty()) { + Work work = completionQueue.front(); + completionQueue.pop(); + uv_mutex_unlock(&completionMutex); // perform the queued loop callback - (*work.loopCallback)(work.data); + (*work.completionCallback)(work.data); callbacksCompleted++; - uv_mutex_lock(&loopMutex); + uv_mutex_lock(&completionMutex); } - uv_mutex_unlock(&loopMutex); + uv_mutex_unlock(&completionMutex); uv_mutex_lock(&workMutex); // if there is no ongoing work / completion processing, node doesn't need // to be prevented from terminating workInProgressCount -= callbacksCompleted; if(!workInProgressCount) { - uv_unref((uv_handle_t *)&loopAsync); + uv_unref((uv_handle_t *)&completionAsync); } uv_mutex_unlock(&workMutex); } + +void ThreadPool::RunReverseCallbacks(uv_async_t* handle) { + static_cast(handle->data)->RunReverseCallbacks(); +} + +void ThreadPool::RunReverseCallbacks() { + // get the next callback to run + uv_mutex_lock(&reverseMutex); + ReverseCall reverseCall = reverseQueue.front(); + uv_mutex_unlock(&reverseMutex); + + // execute callback + (*reverseCall.reverseCallback)(reverseCall.data); + + // pop the queue, and if necessary, re-trigger RunReverseCallbacks + uv_mutex_lock(&reverseMutex); + reverseQueue.pop(); + if (!reverseQueue.empty()) { + uv_async_send(&reverseAsync); + } + uv_mutex_unlock(&reverseMutex); +} From c0c383fc3a82e3a2028b7e7e92f00aa11c8dc56f Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 13:42:06 -0700 Subject: [PATCH 45/53] Use ExecuteReverseCallback --- .../templates/manual/include/async_baton.h | 28 +++++++++++-------- .../templates/manual/include/thread_pool.h | 4 +++ .../templates/partials/callback_helpers.cc | 12 ++++---- .../templates/partials/field_accessors.cc | 14 ++++------ generate/templates/templates/class_header.h | 2 +- generate/templates/templates/struct_header.h | 2 +- 6 files changed, 33 insertions(+), 29 deletions(-) diff --git a/generate/templates/manual/include/async_baton.h b/generate/templates/manual/include/async_baton.h index fee87c4c1..cfae13b31 100644 --- a/generate/templates/manual/include/async_baton.h +++ b/generate/templates/manual/include/async_baton.h @@ -5,15 +5,13 @@ #include #include "lock_master.h" -#include "functions/sleep_for_ms.h" +#include "nodegit.h" // Base class for Batons used for callbacks (for example, // JS functions passed as callback parameters, // or field properties of configuration objects whose values are callbacks) struct AsyncBaton { - uv_async_t req; - - bool done; + uv_sem_t semaphore; }; template @@ -23,22 +21,28 @@ struct AsyncBatonWithResult : public AsyncBaton { AsyncBatonWithResult(const ResultT &defaultResult) : defaultResult(defaultResult) { + uv_sem_init(&semaphore, 0); + } + + ~AsyncBatonWithResult() { + uv_sem_destroy(&semaphore); + } + + void Done() { + // signal completion + uv_sem_post(&semaphore); } - ResultT ExecuteAsync(uv_async_cb asyncCallback) { + ResultT ExecuteAsync(ThreadPool::Callback asyncCallback) { result = 0; - req.data = this; - done = false; - uv_async_init(uv_default_loop(), &req, asyncCallback); { LockMaster::TemporaryUnlock temporaryUnlock; - uv_async_send(&req); + libgit2ThreadPool.ExecuteReverseCallback(asyncCallback, this); - while(!done) { - sleep_for_ms(1); - } + // wait for completion + uv_sem_wait(&semaphore); } return result; diff --git a/generate/templates/manual/include/thread_pool.h b/generate/templates/manual/include/thread_pool.h index bcb3590d7..a1eeabbfd 100644 --- a/generate/templates/manual/include/thread_pool.h +++ b/generate/templates/manual/include/thread_pool.h @@ -5,7 +5,10 @@ #include class ThreadPool { +public: typedef void (*Callback) (void *); + +private: struct Work { Callback workCallback; Callback completionCallback; @@ -47,6 +50,7 @@ class ThreadPool { void RunCompletionCallbacks(); static void RunReverseCallbacks(uv_async_t *handle); void RunReverseCallbacks(); + public: // Initializes thread pool and spins up the requested number of threads // The provided loop will be used for completion callbacks, whenever diff --git a/generate/templates/partials/callback_helpers.cc b/generate/templates/partials/callback_helpers.cc index c4b435787..1a1e6b1be 100644 --- a/generate/templates/partials/callback_helpers.cc +++ b/generate/templates/partials/callback_helpers.cc @@ -13,13 +13,13 @@ baton->{{ arg.name }} = {{ arg.name }}; {% endeach %} - return baton->ExecuteAsync((uv_async_cb) {{ cppFunctionName }}_{{ cbFunction.name }}_async); + return baton->ExecuteAsync({{ cppFunctionName }}_{{ cbFunction.name }}_async); } -void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_async_t* req, int status) { +void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void *untypedBaton) { Nan::HandleScope scope; - {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(req->data); + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = static_cast<{{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton*>(untypedBaton); {% each cbFunction.args|argsInfo as arg %} {% if arg | isPayload %} @@ -57,8 +57,6 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_as Nan::TryCatch tryCatch; Local result = callback->Call({{ cbFunction.args|jsArgsCount }}, argv); - uv_close((uv_handle_t*) &baton->req, NULL); - if(PromiseCompletion::ForwardIfPromise(result, baton, {{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted)) { return; } @@ -88,7 +86,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(uv_as } {% endeach %} - baton->done = true; + baton->Done(); } void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result) { @@ -132,7 +130,7 @@ void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_promiseComp baton->result = {{ cbFunction.return.error }}; } - baton->done = true; + baton->Done(); } {%endif%} {%endeach%} diff --git a/generate/templates/partials/field_accessors.cc b/generate/templates/partials/field_accessors.cc index 0098d06b4..ca7f3781b 100644 --- a/generate/templates/partials/field_accessors.cc +++ b/generate/templates/partials/field_accessors.cc @@ -124,13 +124,13 @@ return baton->defaultResult; } - return baton->ExecuteAsync((uv_async_cb) {{ field.name }}_async); + return baton->ExecuteAsync({{ field.name }}_async); } - void {{ cppClassName }}::{{ field.name }}_async(uv_async_t* req, int status) { + void {{ cppClassName }}::{{ field.name }}_async(void *untypedBaton) { Nan::HandleScope scope; - {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(req->data); + {{ field.name|titleCase }}Baton* baton = static_cast<{{ field.name|titleCase }}Baton*>(untypedBaton); {{ cppClassName }}* instance = {{ field.name }}_getInstanceFromBaton(baton); if (instance->{{ field.name }}.GetCallback()->IsEmpty()) { @@ -138,7 +138,7 @@ baton->result = baton->defaultResult; // no results acquired {% endif %} - baton->done = true; + baton->Done(); return; } @@ -179,8 +179,6 @@ Nan::TryCatch tryCatch; Local result = instance->{{ field.name }}.GetCallback()->Call({{ field.args|jsArgsCount }}, argv); - uv_close((uv_handle_t*) &baton->req, NULL); - if(PromiseCompletion::ForwardIfPromise(result, baton, {{ cppClassName }}::{{ field.name }}_promiseCompleted)) { return; } @@ -209,7 +207,7 @@ baton->result = baton->defaultResult; } {% endeach %} - baton->done = true; + baton->Done(); } void {{ cppClassName }}::{{ field.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result) { @@ -253,7 +251,7 @@ baton->result = {{ field.return.error }}; } - baton->done = true; + baton->Done(); } {% endif %} {% endif %} diff --git a/generate/templates/templates/class_header.h b/generate/templates/templates/class_header.h index aff51243a..6f19f517f 100644 --- a/generate/templates/templates/class_header.h +++ b/generate/templates/templates/class_header.h @@ -67,7 +67,7 @@ class {{ cppClassName }} : public {% endeach %} ); - static void {{ function.cppFunctionName }}_{{ arg.name }}_async(uv_async_t* req, int status); + static void {{ function.cppFunctionName }}_{{ arg.name }}_async(void *baton); static void {{ function.cppFunctionName }}_{{ arg.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result); struct {{ function.cppFunctionName }}_{{ arg.name|titleCase }}Baton : public AsyncBatonWithResult<{{ arg.return.type }}> { {% each arg.args|argsInfo as cbArg %} diff --git a/generate/templates/templates/struct_header.h b/generate/templates/templates/struct_header.h index 122a55c0a..dd8f8570e 100644 --- a/generate/templates/templates/struct_header.h +++ b/generate/templates/templates/struct_header.h @@ -44,7 +44,7 @@ class {{ cppClassName }} : public NodeGitWrapper<{{ cppClassName }}Traits> { {% endeach %} ); - static void {{ field.name }}_async(uv_async_t* req, int status); + static void {{ field.name }}_async(void *baton); static void {{ field.name }}_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local result); struct {{ field.name|titleCase }}Baton : public AsyncBatonWithResult<{{ field.return.type }}> { {% each field.args|argsInfo as arg %} From 884900ff362413d663522bdd8218f5395ef134fd Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 16:13:20 -0700 Subject: [PATCH 46/53] Allocate baton on stack --- generate/templates/partials/callback_helpers.cc | 7 +++---- generate/templates/partials/field_accessors.cc | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/generate/templates/partials/callback_helpers.cc b/generate/templates/partials/callback_helpers.cc index 1a1e6b1be..acd44f424 100644 --- a/generate/templates/partials/callback_helpers.cc +++ b/generate/templates/partials/callback_helpers.cc @@ -6,14 +6,13 @@ {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} {% endeach %} ) { - {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton* baton = - new {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton({{ cbFunction.return.noResults }}); + {{ cppFunctionName }}_{{ cbFunction.name|titleCase }}Baton baton({{ cbFunction.return.noResults }}); {% each cbFunction.args|argsInfo as arg %} - baton->{{ arg.name }} = {{ arg.name }}; + baton.{{ arg.name }} = {{ arg.name }}; {% endeach %} - return baton->ExecuteAsync({{ cppFunctionName }}_{{ cbFunction.name }}_async); + return baton.ExecuteAsync({{ cppFunctionName }}_{{ cbFunction.name }}_async); } void {{ cppClassName }}::{{ cppFunctionName }}_{{ cbFunction.name }}_async(void *untypedBaton) { diff --git a/generate/templates/partials/field_accessors.cc b/generate/templates/partials/field_accessors.cc index ca7f3781b..f9f9065a0 100644 --- a/generate/templates/partials/field_accessors.cc +++ b/generate/templates/partials/field_accessors.cc @@ -111,20 +111,19 @@ {{ arg.cType }} {{ arg.name}}{% if not arg.lastArg %},{% endif %} {% endeach %} ) { - {{ field.name|titleCase }}Baton* baton = - new {{ field.name|titleCase }}Baton({{ field.return.noResults }}); + {{ field.name|titleCase }}Baton baton({{ field.return.noResults }}); {% each field.args|argsInfo as arg %} - baton->{{ arg.name }} = {{ arg.name }}; + baton.{{ arg.name }} = {{ arg.name }}; {% endeach %} - {{ cppClassName }}* instance = {{ field.name }}_getInstanceFromBaton(baton); + {{ cppClassName }}* instance = {{ field.name }}_getInstanceFromBaton(&baton); if (instance->{{ field.name }}.WillBeThrottled()) { - return baton->defaultResult; + return baton.defaultResult; } - return baton->ExecuteAsync({{ field.name }}_async); + return baton.ExecuteAsync({{ field.name }}_async); } void {{ cppClassName }}::{{ field.name }}_async(void *untypedBaton) { From acb6c41a7a82972f67cbcaf888febceff03a3fa3 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 16:17:05 -0700 Subject: [PATCH 47/53] Remove sleep_for_ms --- .../manual/include/functions/sleep_for_ms.h | 6 ------ .../manual/src/functions/sleep_for_ms.cc | 16 ---------------- generate/templates/templates/binding.gyp | 1 - 3 files changed, 23 deletions(-) delete mode 100644 generate/templates/manual/include/functions/sleep_for_ms.h delete mode 100644 generate/templates/manual/src/functions/sleep_for_ms.cc diff --git a/generate/templates/manual/include/functions/sleep_for_ms.h b/generate/templates/manual/include/functions/sleep_for_ms.h deleted file mode 100644 index 903299268..000000000 --- a/generate/templates/manual/include/functions/sleep_for_ms.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SLEEP_FOR_MS_H -#define SLEEP_FOR_MS_H - -void sleep_for_ms(int milliseconds); - -#endif diff --git a/generate/templates/manual/src/functions/sleep_for_ms.cc b/generate/templates/manual/src/functions/sleep_for_ms.cc deleted file mode 100644 index 11b6a72f6..000000000 --- a/generate/templates/manual/src/functions/sleep_for_ms.cc +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef WIN32 -#include -#else -#include -#endif // win32 - -void sleep_for_ms(int milliseconds) { - #ifdef WIN32 - Sleep(milliseconds); - #else - struct timespec t; - t.tv_sec = 0; - t.tv_nsec = milliseconds * 1000000; // 1 milliseconds == 1,000,000 nanoseconds - nanosleep(&t, NULL); - #endif -} diff --git a/generate/templates/templates/binding.gyp b/generate/templates/templates/binding.gyp index 457221dcd..142ae7f05 100644 --- a/generate/templates/templates/binding.gyp +++ b/generate/templates/templates/binding.gyp @@ -18,7 +18,6 @@ "src/promise_completion.cc", "src/wrapper.cc", "src/functions/copy.cc", - "src/functions/sleep_for_ms.cc", "src/convenient_patch.cc", "src/convenient_hunk.cc", "src/str_array_converter.cc", From 45ce97db1efd765b98a5db6d0cab4521724593eb Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 30 Jan 2017 12:54:06 -0700 Subject: [PATCH 48/53] Allow both types of failures for invalid credentials test --- test/tests/remote.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/tests/remote.js b/test/tests/remote.js index 583618605..dfe3fb318 100644 --- a/test/tests/remote.js +++ b/test/tests/remote.js @@ -1,6 +1,7 @@ var assert = require("assert"); var path = require("path"); var local = path.join.bind(path, __dirname); +var _ = require("lodash"); var garbageCollect = require("../utils/garbage_collect.js"); @@ -388,8 +389,15 @@ describe("Remote", function() { // catches linux / osx failure to use anonymous credentials // stops callback infinite loop .catch(function (reason) { - assert.equal(reason.message.replace(/\n|\r/g, ""), - "failed to set credentials: The parameter is incorrect."); + const messageWithoutNewlines = reason.message.replace(/\n|\r/g, ""); + const validErrors = [ + "Method push has thrown an error.", + "failed to set credentials: The parameter is incorrect." + ]; + assert.ok( + _.includes(validErrors, messageWithoutNewlines), + "Unexpected error: " + reason.message + ); }); }); From 3db424ef0b9521d4dff43c21c3e79f49a0142ccc Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Wed, 1 Feb 2017 09:54:39 -0700 Subject: [PATCH 49/53] Bump libgit to 0bf0526 --- vendor/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libgit2 b/vendor/libgit2 index 39e76bb34..0bf052600 160000 --- a/vendor/libgit2 +++ b/vendor/libgit2 @@ -1 +1 @@ -Subproject commit 39e76bb346760ad1183e8253186df3044752341e +Subproject commit 0bf05260089002b8101a0be1f79261b3211b10db From 6d7762b9ce475bfa5db9249598f6629db636d458 Mon Sep 17 00:00:00 2001 From: Stjepan Rajko Date: Mon, 6 Feb 2017 08:22:12 -0700 Subject: [PATCH 50/53] Unreference handle to allow node to terminate --- generate/templates/manual/src/thread_pool.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/generate/templates/manual/src/thread_pool.cc b/generate/templates/manual/src/thread_pool.cc index c89da76a3..d8bedc96e 100644 --- a/generate/templates/manual/src/thread_pool.cc +++ b/generate/templates/manual/src/thread_pool.cc @@ -11,6 +11,7 @@ ThreadPool::ThreadPool(int numberOfThreads, uv_loop_t *loop) { uv_async_init(loop, &reverseAsync, RunReverseCallbacks); reverseAsync.data = this; + uv_unref((uv_handle_t *)&reverseAsync); uv_mutex_init(&reverseMutex); workInProgressCount = 0; From 5d807ebf9efd193cec565540326783aa0f7fb58b Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 6 Feb 2017 10:39:15 -0700 Subject: [PATCH 51/53] Update changelog for v0.16.0 --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 815a96c5a..885a631a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## v0.16.0 [(2016-09-15)](https://github.com/nodegit/nodegit/releases/tag/v0.16.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.15.1...v0.16.0) + +- Bump libssh2 to 1.7.0 [PR #1071](https://github.com/nodegit/nodegit/pull1071) +- Js cleanup [PR #1074](https://github.com/nodegit/nodegit/pull1074) +- Expose merge options and diff flags [PR #1076](https://github.com/nodegit/nodegit/pull1076) +- Fix Tree#entryByName function and add test [PR #1079](https://github.com/nodegit/nodegit/pull1079) +- Add isSubmodule() method [PR #1080](https://github.com/nodegit/nodegit/pull1080) +- Fix two typos in the documentation for Commit#parents [PR #1081](https://github.com/nodegit/nodegit/pull1081) +- Memory management: duplicate time [PR #1090](https://github.com/nodegit/nodegit/pull1090) +- Preempt nan to fix deprecated calls to Get/SetHiddenValue [PR #1106](https://github.com/nodegit/nodegit/pull1106) +- Try re-enabling node >6.2 [PR #1107](https://github.com/nodegit/nodegit/pull1107) +- Bump openssl to 1.0.2h (same as node 6.3.1) [PR #1108](https://github.com/nodegit/nodegit/pull1108) +- Don't run postbuild when we detect electron install [PR #1111](https://github.com/nodegit/nodegit/pull1111) +- Added instructions for CircleCI users [PR #1113](https://github.com/nodegit/nodegit/pull1113) +- Fix up electron and nw.js docs [PR #1114](https://github.com/nodegit/nodegit/pull1114) +- Patch libssh2 to work with vs2015 [PR #1125](https://github.com/nodegit/nodegit/pull1125) +- Fix CI [PR #1126](https://github.com/nodegit/nodegit/pull1126) + + ## v0.15.1 [(2016-06-20)](https://github.com/nodegit/nodegit/releases/tag/v0.15.1) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.15.0...v0.15.1) From b894ccf700091b80c5db9ffb9bc2d76f93d1dcfc Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 6 Feb 2017 13:17:58 -0700 Subject: [PATCH 52/53] Bump to v0.17 --- CHANGELOG.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- package.json | 2 +- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 885a631a9..dd0f485da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # Change Log +## v0.17.0 [(2017-01-06)](https://github.com/nodegit/nodegit/releases/tag/v0.17.0) + +[Full Changelog](https://github.com/nodegit/nodegit/compare/v0.16.0...v0.17.0) + +### Targeted Platform Changes + +In this release we had added support for Node v7 and latest Electron. We have removed support for Node v0.12 and v5. + +We are also deprecating nw.js support since it is currently broken, no one in the current team uses it and we would not be able to currently support nw.js in an effective manner with a good user experience. + +### Now building against shared libcurl lib + +For proxy support we now use libcurl for HTTP/HTTPS transport which should have no noticeable change in NodeGit remote operations but if changes are noticed this is worth mentioning as a potential source. + +### Memory leak fixes and stability increases + +Many PR's were made to fix memory leaks as they were found so memory usage should go down in this version for long running scripts. Additionally, when performing operations with callbacks (transfer progress, credentials, etc...) there was a small chance for a segfault when NodeGit would schedule the callback to go into JavaScript. This is now fixed. + +### Fixes to the build + +Many users, especially on windows, were experiencing errors during the build. The build still isn't perfect but a lot of the bugs were fixed. + +### Bump libgit2 to 0bf0526 + +The majority of changes to NodeGit v17 were in libgit2. The API breaking changes that are known are: + +- `RevWalk` is returning different results [libgit2 PR #3921](https://github.com/libgit2/libgit2/pull/3921) +- Changes in error messages returned [libgit2 PR #4049](https://github.com/libgit2/libgit2/pull/4049) + +Summary of changes that were brought in: + +https://github.com/nodegit/nodegit/pull/1187#issuecomment-277760323 + +- Define GIT_SSH_MEMORY_CREDENTIALS for libgit2 [PR #949](https://github.com/nodegit/nodegit/pull/949) +- Add "Path" to ssh variable names in tests for clarity [PR #1135](https://github.com/nodegit/nodegit/pull/1135) +- Fix revwalk memory leaks [PR #1137](https://github.com/nodegit/nodegit/pull/1137) +- Fix tree entry leaks [PR #1138](https://github.com/nodegit/nodegit/pull/1138) +- Fix typo in postinstall script [PR #1141](https://github.com/nodegit/nodegit/pull/1141) +- Fix windows exception handling in build [PR #1143](https://github.com/nodegit/nodegit/pull/1143) +- Fix CI failures on node 0.12 [PR #1144](https://github.com/nodegit/nodegit/pull/1144) +- Fix postinstall script crash when install location has spaces in its path [PR #1148](https://github.com/nodegit/nodegit/pull/1148) +- Update 0.13 changelog [PR #1151](https://github.com/nodegit/nodegit/pull/1151) +- Minor documentation fix in Checkout.index [PR #1164](https://github.com/nodegit/nodegit/pull/1164) +- FreeBSD also uses struct timespec st_mtim [PR #1165](https://github.com/nodegit/nodegit/pull/1165) +- README.md needs to show where to get Slack invitation [PR #1170](https://github.com/nodegit/nodegit/pull/1170) +- Add @async tag to `Tree#getEntry` [PR #1178](https://github.com/nodegit/nodegit/pull/1178) +- Fix incorrect anchor link in TESTING.md [PR #1179](https://github.com/nodegit/nodegit/pull/1179) +- Added tests for Tag [PR #1180](https://github.com/nodegit/nodegit/pull/1180) +- Added tests for Branch [PR #1181](https://github.com/nodegit/nodegit/pull/1181) +- Escape the spaces in dir for shell command [PR #1186](https://github.com/nodegit/nodegit/pull/1186) +- Bump libgit to 0bf0526 [PR #1187](https://github.com/nodegit/nodegit/pull/1187) +- Checkout's tree* functions do not support Oid as a parameter [PR #1190](https://github.com/nodegit/nodegit/pull/1190) +- Build against shared library for libcurl [PR #1195](https://github.com/nodegit/nodegit/pull/1195) +- Move libuv calls to correct thread [PR #1197](https://github.com/nodegit/nodegit/pull/1197) +- Update `Repository#createBranch` docs [PR #1198](https://github.com/nodegit/nodegit/pull/1198) +- Remove Node v0.12 and v5 [PR #1199](https://github.com/nodegit/nodegit/pull/1199) +- Specify acceptable types for `lookup` and `dwim` in Reference [PR #1203](https://github.com/nodegit/nodegit/pull/1203) +- Build for Node 7.4.0 [PR #1204](https://github.com/nodegit/nodegit/pull/1204) +- Write the index to a repository directly in merge-cleanly.js examples [PR #1205](https://github.com/nodegit/nodegit/pull/1205) + ## v0.16.0 [(2016-09-15)](https://github.com/nodegit/nodegit/releases/tag/v0.16.0) [Full Changelog](https://github.com/nodegit/nodegit/compare/v0.15.1...v0.16.0) diff --git a/README.md b/README.md index cc3d7f7b2..84eed5ff8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ NodeGit -**Stable (libgit2#master): 0.16.0** +**Stable (libgit2#master): 0.17.0** **Stable (libgit2@0.24): 0.14.1** ## Have a problem? Come chat with us! ## diff --git a/package.json b/package.json index 99a566a81..9b04d878d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegit", "description": "Node.js libgit2 asynchronous native bindings", - "version": "0.16.0", + "version": "0.17.0", "homepage": "http://nodegit.org", "keywords": [ "libgit2", From 248afda308a4d16f62373827de33fe3f8297e7f2 Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 6 Feb 2017 13:36:47 -0700 Subject: [PATCH 53/53] Add header to separate v0.17 libgit2 changes vs NodeGit specific changes --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0f485da..7be1c515b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ Summary of changes that were brought in: https://github.com/nodegit/nodegit/pull/1187#issuecomment-277760323 +### Changes to NodeGit outside of libgit2 bump + - Define GIT_SSH_MEMORY_CREDENTIALS for libgit2 [PR #949](https://github.com/nodegit/nodegit/pull/949) - Add "Path" to ssh variable names in tests for clarity [PR #1135](https://github.com/nodegit/nodegit/pull/1135) - Fix revwalk memory leaks [PR #1137](https://github.com/nodegit/nodegit/pull/1137)