This is a big update! Lots of work was done to bring NodeGit up to the latest stable libgit2 version (v0.24.1), to use babel in the library, to make it more stable, remove memory leaks, squash bugs and in general just improve the library for all. Make sure to see all of the API changes below (there are a lot).
We have added Node 6 as a supported platform! Going forward we aim to have 1:1 support for versions of Node that are either current or LTS. That means that v0.12 will not be supported soon so if you're on that please upgrade to at least Node v4. Also Node v5 will NOT be LTS so when Node stops supporting that in the coming months we will as well. You can read more about the current Node upgrade plan here.
Index#writeTreeToare all now asynchronous functions PR #971
theirEntryoptional parameters on
Repository#refreshIndexwill return an Index object back that has the latest data loaded off of disk PR #986
Commit.createis now asynchronous PR #1022
Diff#mergewill combine a diff into itself PR #1000
ReflogEntry#messagehave been added PR #1013
Reflog#entryMessagehave been moved to be under
Branch.nameworks now PR #991
- Fixed a crash with callbacks from libgit2 PR #944
- Fixed a crash in
- More memory leaks have been plugged PR #1005, PR #1006, PR #1014, and PR #1015
Commit#getDiffWithOptionsnow actually passes the options correctly PR #1008
Upgraded to libgit2 v0.24.1 PR #1010
Changes or improvements
Custom merge drivers can now be registered, which allows callers to
configure callbacks to honor
Custom filters can now be registered with wildcard attributes, for
filter=*. Consumers should examine the attributes parameter
checkfunction for details.
Symlinks are now followed when locking a file, which can be
necessary when multiple worktrees share a base repository.
You can now set your own user-agent to be sent for HTTP requests by
You can set custom HTTP header fields to be sent along with requests
by passing them in the fetch and push options.
Tree objects are now assumed to be sorted. If a tree is not
correctly formed, it will give bad results. This is the git approach
and cuts a significant amount of time when reading the trees.
Filter registration is now protected against concurrent
Filenames which are not valid on Windows in an index no longer cause
to fail to parse it on that OS.
Rebases can now be performed purely in-memory, without touching the
When adding objects to the index, or when creating new tree or commit
objects, the inputs are validated to ensure that the dependent objects
exist and are of the correct type. This object validation can be
disabled with the
The WinHTTP transport's handling of bad credentials now behaves like
the others, asking for credentials again.
Blob.createFromStreamCommitallow you to create a blob by
writing into a stream. Useful when you do not know the final size or
want to copy the contents from another stream.
Config#lockhas been added, which allow for
transactional/atomic complex updates to the configuration, removing
the opportunity for concurrent operations and not committing any
changes until the unlock.
DiffOptionsadded a new callback
progress_cbto report on the
progress of the diff as files are being compared. The documentation of
the existing callback
notify_cbwas updated to reflect that it only
gets called when new deltas are added to the diff.
PushOptionshave gained a
field to set the extra HTTP header fields to send.
Commit#headerFieldallows you to look up a specific header
field in a commit.
Breaking API changes
MergeOptionsnow provides a
defaultDriverthat can be used
to provide the name of a merge driver to be used to handle files changed
during a merge.
treeFlagsfield of the
MergeOptionsstructure is now named
Merge.FILE_FLAGSenum is now
consistency with other enum type names.
Certdescendent types now have a proper
It is the responsibility of the refdb backend to decide what to do
with the reflog on ref deletion. The file-based backend must delete
it, a database-backed one may wish to archive it.
Index#conflictAddwill now use the case
as provided by the caller on case insensitive systems. Previous
versions would keep the case as it existed in the index. This does
not affect the higher-level
Config.LEVELenum has gained a higher-priority value
PROGRAMDATAwhich represent a rough Windows equivalent
to the system level configuration.
RebaseOptionsnow has a
The index no longer performs locking itself. This is not something
users of the library should have been relying on as it's not part of
the concurrency guarantees.
Remote#connect()now takes a
customHeadersargument to set
the extra HTTP header fields to send.
Tree.entryTypehave all been moved to the
TreeEntryfields have been removed in lieu of the corresponding functions to return
Ignore.pathIsIgnoredasync PR #970
- Added an error message when trying to install NodeGit without a required version of libstdc++ PR #972
- Fix a crash when grabbing content out of a buffer that has unicode PR #966
- Added some plumbing for better memory management PR #958
- Fixed install when there is a space in the username on windows PR #951
- Bump to email@example.com PR #952
- Improved speed of all callbacks dramatically PR #932
Merge.mergedocs to show it takes in an
AnnotatedCommitand not a
- Fixed unicode in
Diff.blobToBuffergetting corrupted PR #935
- Fixed fetching/pulling to bitbucket in versions > v5.6 of node PR #942
Repository#createCommitOnHeadno longer dies if the repo is empty PR #927
- Fixed memory leak in
- Generated files now have a header comment indicating that they are generated PR #924
- Fixed http parsing errors in Node 5.6 PR #931
Tree#walknot returning the correct entries on