v0.25.0
版本发布时间: 2019-08-10 00:47:29
nodegit/nodegit最新发布版本:v0.27.0(2020-07-29 04:19:19)
Summary of changes
BREAKING
-
getRemotes
no longer returns remote names, it now returns remote objects directly. UsegetRemoteNames
to get a list of remote names. - Converted Buf.prototype.set and Buf.prototype.grow from async to sync
-
Repository.prototype.continueRebase
will now throw on any error except for EAPPLIED on the first call toRebase.prototype.next
- Drops support for Ubuntu 14 after EOL
- Removed access to the
diff_so_far
param ingit_diff_notify_cb
andgit_diff_progress_cb
- Changed
FilterSource.prototype.repo
to async to prevent segfaults on filters that run duringSubmodule.status
- Changed
NodeGit.Signature.default
to async, because it actually ends up reading the config. - Fixed bug where templates were not reporting errors for synchronous methods. It's a bit of a wide net, but in general, it is now possible certain sync methods in NodeGit will begin failing that did not fail before. This is the correct behavior.
Deprecations
- Support signing commits in
Repository.prototype.mergeBranches
. The last parameterprocessMergeMessageCallback
is now deprecated, but will continue to work. Use the options object instead, which will contain theprocessMergeMessageCallback
, as well as thesigningCb
.
New
- Support for Node 12
- Add signing support for commits and annotated tags
- Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback
pattern for signing commits or tags should use the exact same callback type and with the same meaning.
type SigningCallback = (content: string) => {| code: number, field?: string, signedData?: string |};
If the code isNodeGit.Error.CODE.OK
or 0, the operation will succeed and at least signedData is expected to be filled out. If the code is a negative number, except forNodeGit.Error.CODE.PASSTHROUGH
, the signing operation will fail. If the code isNodeGit.Error.CODE.PASSTHROUGH
, the operation will continue without signing the object.
- Enforced consistent use of signing callbacks within the application. Any object that implements the signingCallback
pattern for signing commits or tags should use the exact same callback type and with the same meaning.
- Exposed
AnnotatedCommit
methods:-
AnnotatedCommit.prototype.ref
-
- Exposed
Apply
methods:-
Apply.apply
applies a diff to the repository -
Apply.toTree
applies a diff to a tree
-
- Exposed
Config
methods:-
Config.prototype.deleteEntry
-
Config.prototype.deleteMultivar
-
Config.prototype.getBool
-
Config.prototype.getInt32
-
Config.prototype.getInt64
-
Config.prototype.setMultivar
-
Config.prototype.snapshot
-
- Exposed
ConfigIterator
with methods:-
ConfigIterator.create
-
ConfigIterator.createGlob
-
ConfigIterator.createMultivar
-
ConfigIterator.prototype.next
-
- Exposed
IndexNameEntry
:-
IndexNameEntry.add
-
IndexNameEntry.clear
-
IndexNameEntry.entryCount
-
IndexNameEntry.getByIndex
-
IndexNameEntry.prototype.ancestor
-
IndexNameEntry.prototype.ours
-
IndexNameEntry.prototype.theirs
-
- Exposed
IndexReucEntry
:-
IndexReucEntry.add
-
IndexReucEntry.clear
-
IndexReucEntry.entryCount
-
IndexReucEntry.find
-
IndexReucEntry.getByIndex
-
IndexReucEntry.getByPath
-
IndexReucEntry.remove
-
IndexReucEntry.prototype.mode
-
IndexReucEntry.prototype.oid
-
IndexReucEntry.prototype.path
-
- Exposed
Mailmap
:-
Mailmap.prototype.addEntry
-
Mailmap.fromBuffer
-
Mailmap.fromRepository
-
Mailmap.create
-
Mailmap.prototype.resolve
-
Mailmap.prototype.resolveSignature
-
- Exposed
Merge
methods:-
Merge.analysis
-
Merge.analysisForRef
-
- Exposed
Path.isGitfile
- Added
RebaseOptions
toRepository.prototype.rebaseContinue
- Added
NodeGit.Reference.updateTerminal
- Exposed
Remote
methods:-
Remote.createWithOpts
-
- Exposed
Tag.createFromBuffer
- Expose
Tree.prototype.createUpdated(repo, numUpdates, updates)
Fixed
- Updates lodash dependency to address security notice
- Fixed a prototype problem with cherrypick, merge, and other collections that have a function at their root. call, apply, and bind should now be on NodeGit.Cherrypick.
- Bumped libssh2 to resolve security notice.
- Improve speed and correctness of fileHistoryWalk. The API should not have changed; however, when the end of the walk has been reached,
reachedEndOfHistory
will be specified on the resulting array. - Fixes openssl prebuilt downloads for electron builds
- Fixes commits retrieved from
Commit.prototype.parent
- Bump Node-Gyp to 4.0.0 to fix tar security vulnerability
- Optimized a set of routines in NodeGit. These methods as written in Javascript require hundreds or thousands of requests to async workers to retrieve data. We've batched these requests and performed them on a single async worker. There are now native implementations of the following:
-
Repository.prototype.getReferences
: Retrieves all references on async worker. -
Repository.prototype.getRemotes
: Retrieves all remotes on async worker. -
Repository.prototype.getSubmodules
: Retrieves all submodules on async worker. -
Repository.prototype.refreshReferences
: Open sourced function from GitKraken. Grabs a lot of information about references on an async worker. -
Revwalk.prototype.commitWalk
: Retrieves up to N commits from a revwalk on an async worker.
-
- When installing on a machine that has yarn and does not have npm, the preinstall script should succeed now
-
ceiling_dirs
is now an optional parameter toRepository.discover
- Added support for building on IBM i (PASE) machines
- Fixed leak where struct/option types were leaking libgit2 pointers
- Switched
NodeGit.Oid.fromString
's internal implementation fromgit_oid_fromstr
togit_oid_fromstrp
- Fixed builds for Electron 4
- Updated
Signature.prototype.toString
to optionally include timestamps
LibGit2 Bump
- Fixes gitignore issue with pattern negation
-
Remote.list
now gets the correct list of remotes if remotes are changed by external process - Always use builtin regex for linux for portability
- Use Iconv on OSX for better internationalization support.
- Removed LibCurl from LibGit2:
- Now with built-in NTLM proxy support
- Now with built-in Negotiate/Kerberos proxy support
- Working with proxy URLs may be different as curl could auto detect scheme for proxies
- Various git config fixes
- Various git ignore fixes
- Various libgit2 performance improvements
- Windows/Linux now use PCRE for regex, OSX uses regcomp_l, this should address collation issues in diffing
Merged PRs into NodeGit
- Add deprecation warnings for enums that need them. #1711
- https://github.com/nodegit/nodegit/pull/1706
- Reintroduce Odb.prototype.addDiskAlternate #1695
- Fix behaviour of Repository#getReferences #1708
- Bump libgit2 #1705
- Fix Tree#createUpdated #1704
- Fix failing tests on CI #1703
- Audit lodash and fix package-lock.json #1702
- Implement support for Node 12 #1696
- Remove NSEC #1699
- Use builtin regex library for linux for better portability #1693
- Remove pcre-config from binding.gyp #1694
- refresh_references.cc: skip refs that can't be directly resolved #1689
- Bump libgit2 to fork of latest master #1690
- Bump libssh2 to 1.8.2 and fix some npm audit warnings #1678
- Root functions should keep their function prototypes correctly #1681
- refresh_references.cc: bust LibGit2 remote list cache by reading config #1685
- Implement faster file history walk #1676
- EOL for Node 6 and Ubuntu 14.04 #1649
- Ensures that commits from parent(*) has a repository #1658
- Update openssl conan distributions #1663
- Support signing in Repository#mergeBranches #1664
- Dependency upgrade node-gyp upgraded to 4.0.0 #1672
- Add additional getters to streamline information gathering (breaking change) #1671
- Clean up some dangerous memory accesses in callbacks #1642
- Output the item that was deprecated when giving deprecation notice #1643
- Don't fail yarn installs when we can't find npm #1644
-
ceiling_dirs
parameter inRepository.discover
is optional #1245 -
Add missing
shouldAlloc
declarations for git_merge_analysis* functions #1641 - Fix regex state causing subsequent runs of Tag.extractSignature to fail #1630
- Update LibGit2 docs to v0.28.0 #1631
- Add support for building on IBM i (PASE) #1634
- Expose more config methods #1635
- Catch errors and pass them to libgit2 as error codes in rebase signingcb #1636
- Simplify check for IBM i operating system #1637
- Bump LibGit2 to fork of v0.28.1 #1638
- We should clear the persistent cell in structs when they are destroyed #1629
- Fix "errorno" typo #1628
- Bump Libgit2 fork to v0.28.0 #1627
- Fix macOS and Windows Electron 4 builds #1626
- Fix non-existent / dangling refs cause Repository.prototype.createCommitWithSignature to fail #1624
- Handle new gyp information for electron builds #1623
- Use same API for signingCb in all places that can be crypto signed #1621
- Breaking: Repository.prototype.continueRebase enhancements #1619
- adds support for gpg commit signing (fixes #1018) #1448
-
Add
updateRef
parameter to Repository#createCommitWithSignature #1610 - Documentation fixes. #1611
- Add Commit#amendWithSignature #1616
- Bump libgit2 to a preview of v0.28 #1615
- Fix issues with Commit#amendWithSignature #1617
- Marked Repository.createBlobFromBuffer as async #1614
- Add functionality for creating Tags with signatures and extracting signatures from Tags #1618
Merged PRs into LibGit2
- Add sign capability to git_rebase_commit #4913
- Parallelize checkout_create_the_new for perf #4205
- config_file: refresh when creating an iterator
- azure: drop powershell
- fuzzer: use futils instead of fileops
- w32: fix unlinking of directory symlinks
- patch_parse: fix segfault due to line containing static contents
- ignore: fix determining whether a shorter pattern negates another
- patch_parse: handle missing newline indicator in old file
- patch_parse: do not depend on parsed buffer's lifetime
- sha1: fix compilation of WinHTTP backend
- repository: do not initialize HEAD if it's provided by templates
- configuration: cvar -> configmap
- Evict cache items more efficiently
- clar: fix suite count
- Ignore VS2017 specific files and folders
- gitattributes: ignore macros defined in subdirectories
- clar: correctly account for "data" suites when counting
- Allocate memory more efficiently when packing objects
- fileops: fix creation of directory in filesystem root
- win32: fix fuzzers and have CI build them
- Config parser separation
- config_file: implement stat cache to avoid repeated rehashing
- ci: build with ENABLE_WERROR on Windows
- Fix Regression: attr: Correctly load system attr file (on Windows)
- hash: fix missing error return on production builds
- Resolve static check warnings in example code
- Multiple hash algorithms
- More documentation
- Incomplete commondir support
- Remove warnings
- Re-run flaky tests
- errors: use lowercase
- largefile tests: only write 2GB on 32-bit platforms
- Fix broken link in README
-
net: remove unused
git_headlist_cb
- cmake: default NTLM client to off if no HTTPS support
- attr: rename constants and macros for consistency
-
Change API instances of
fromnoun
tofrom_noun
(with an underscore) - object: rename git_object__size to git_object_size
- Replace fnmatch with wildmatch
- Documentation fixes
-
Removal of
p_fallocate
- Modularize our TLS & hash detection
- tests: merge::analysis: use test variants to avoid duplicated test suites
- Rename options initialization functions
- deps: ntlmclient: disable implicit fallthrough warnings
- gitignore with escapes
- Handle URLs with a colon after host but no port
- Merge analysis support for bare repos
- Add memleak check docs
- Data-driven tests
- sha1dc: update to fix endianess issues on AIX/HP-UX
- Add NTLM support for HTTP(s) servers and proxies
-
Callback type names should be suffixed with
_cb
- tests: checkout: fix symlink.git being created outside of sandbox
- ignore: handle escaped trailing whitespace
- Ignore: only treat one leading slash as a root identifier
- online tests: use gitlab for auth failures
- Ignore files: don't ignore whitespace
- cache: fix cache eviction using deallocated key
- SECURITY.md: split out security-relevant bits from readme
- Restore NetBSD support
- repository: fix garbage return value
- cmake: disable fallthrough warnings for PCRE
- Configuration parsing: validate section headers with quotes
- Loosen restriction on wildcard "*" refspecs
- Use PCRE for our fallback regex engine when regcomp_l is unavailable
- Remote URL last-chance resolution
- Skip UTF8 BOM in ignore files
-
We've already added
ZLIB_LIBRARIES
toLIBGIT2_LIBS
so don't also add thez
library - Define SYMBOLIC_LINK_FLAG_DIRECTORY if required
- Support symlinks for directories in win32
- rebase: orig_head and onto accessors
-
cmake: correctly detect if system provides
regcomp
- Correctly write to missing locked global config
- [RFC] util: introduce GIT_DOWNCAST macro
- examples: implement SSH authentication
- git_repository_init: stop traversing at windows root
- config_file: check result of git_array_alloc
- patch_parse.c: Handle CRLF in parse_header_start
- fix typo
-
sha1: don't inline
git_hash_global_init
for win32 - ignore: treat paths with trailing "/" as directories
- Test that largefiles can be read through the tree API
- Tests for symlinked user config
- patch_parse: fix parsing addition/deletion of file with space
- Optimize string comparisons
- Negation of subdir ignore causes other subdirs to be unignored
- xdiff: fix typo
- docs: clarify relation of safe and forced checkout strategy
-
Each hash implementation should define
git_hash_global_init
- [Doc] Update URL to git2-rs
- remote: Rename git_remote_completion_type to _t
- odb: provide a free function for custom backends
- Have git_branch_lookup accept GIT_BRANCH_ALL
- Rename git_transfer_progress to git_indexer_progress
- High-level map APIs
- refdb_fs: fix loose/packed refs lookup racing with repacks
- Allocator restructuring
-
cache: fix misnaming of
git_cache_free
- examples: produce single cgit2 binary
- Remove public 'inttypes.h' header
- Prevent reading out of bounds memory
- Fix a memory leak in odb_otype_fast()
- Make stdalloc__reallocarray call stdalloc__realloc
-
Remove
git_time_monotonic
- Fix a very improbable memory leak in git_odb_new()
- ci: publish documentation on merge
- Enable creation of worktree from bare repo's default branch
- Allow bypassing check for '.keep' file
- Deprecation: export the deprecated functions properly
- ci: skip ssh tests on macOS nightly
- CI build fixups
- v0.28 rc1
- Docs
- Documentation fixes
- ci: add an individual coverity pipeline
- ci: run docurium to create documentation
- ci: return coverity to the nightlies
- Clean up some warnings
-
Nightlies: use
latest
docker images - index: preserve extension parsing errors
- Deprecate functions and constants more gently
- Don't use deprecated constants
- Fix VS warning C4098: 'giterr_set_str' : void function returning a value
-
Move
giterr
togit_error
- odb: Fix odb foreach to also close on positive error code
- repository: free memory in symlink detection function
- ci: update poxyproxy, run in quiet mode
- Add/multiply with overflow tweaks
- Improve deprecation of old enums
-
Move
git_ref_t
togit_reference_t
-
More
git_obj
togit_object
updates - ci: only run invasive tests in nightly
- Always build a cdecl library
- changelog: document changes since 0.27
- Fix a bunch of warnings
- mailmap: prefer ethomson@edwardthomson.com
- Convert tests/resources/push.sh to LF endings
- Get rid of some test files that were accidentally committed
- Fix crash on remote connection when GIT_PROXY_AUTO is set but no proxy is detected
- Make ENABLE_WERROR actually work
- Remove unconditional -Wno-deprecated-declaration on macOS
- Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int *' (C4133) on VS
- Fix Linux warnings
- Coverity fixes
- Shutdown callback count
- Update CRLF filtering to match modern git
-
refdb_fs: refactor error handling in
refdb_reflog_fs__delete
- Remove empty (sub-)directories when deleting refs
- Support creating annotated commits from annotated tags
- Fix segfault in loose_backend__readstream
- make proxy_stream_close close target stream even on errors
- Index API updates for consistency
- Allow merge analysis against any reference
- revwalk: Allow changing hide_cb
- Unused function warnings
- Add builtin proxy support for the http transport
- config: fix adding files if their parent directory is a file
- Allow certificate and credential callbacks to decline to act
- Fix warning C4133 incompatible types in MSVC
- index: introduce git_index_iterator
- commit: fix out-of-bound reads when parsing truncated author fields
- tests: 🌀 address two null argument instances #4847
- Some OpenSSL issues
- worktree: Expose git_worktree_add_init_options
- transport/http: Include non-default ports in Host header
- Support symlinks on Windows when core.symlinks=true
- strntol: fix out-of-bounds reads when parsing numbers with leading sign
- apply: small fixups in the test suite
- signature: fix out-of-bounds read when parsing timezone offset
- Remote creation API
- Index collision fixes
- Patch (diff) application
- smart transport: only clear url on hard reset (regression)
- Tree parsing fixes
- CI: Fix macOS leak detection
- README: more CI status badges
- ci: Fix some minor issues
- Object parse fixes
- Windows CI: fail build on test failure
- ci: run all the jobs during nightly builds
- strtol removal
- buf::oom tests: use custom allocator for oom failures
- ci: arm docker builds
- Win32 path canonicalization refactoring
- Check object existence when creating a tree from an index
- Ninja build
- docs: fix transparent/opaque confusion in the conventions file
- Configuration variables can appear on the same line as the section header
- path: export the dotgit-checking functions
- cmake: correct comment from libssh to libssh2
- Object parsing fuzzer
- config: Port config_file_fuzzer to the new in-memory backend.
- Add some more tests for git_futils_rmdir_r and some cleanup
- diff_stats: use git's formatting of renames with common directories
- ignore unsupported http authentication contexts
- submodule: ignore path and url attributes if they look like options
- Smart packet security fixes
- config_file: properly ignore includes without "path" value
- int-conversion
- cmake: enable new quoted argument policy CMP0054
- fix check if blob is uninteresting when inserting tree to packbuilder
- Documentation fixups
- CI: refactoring
- In-memory configuration
- Some warnings
- index: release the snapshot instead of freeing the index
- online::clone: free url and username before resetting
- git_remote_prune to be O(n * logn)
- Rename "VSTS" to "Azure DevOps" and "Azure Pipelines"
- cmake: enable -Wformat and -Wformat-security
- Fix revwalk limiting regression
-
path validation:
char
is not signed by default. - revwalk: refer the sorting modes more to git's options
- Clar XML output redux
- remote: store the connection data in a private struct
- docs: clarify and include licenses of dependencies
- config_file: fix quadratic behaviour when adding config multivars
- config: Fix a leak parsing multi-line config entries
- Prevent heap-buffer-overflow
- ci: remove travis
- Update VSTS YAML files with the latest syntax
- Documentation fixes
- config: convert unbounded recursion into a loop
- Document giterr_last() use only after error. #4772
- util: make the qsort_r check work on macOS
- fuzzer: update for indexer changes
- tree: accept null ids in existing trees when updating
- Pack file verification
- cmake: detect and use libc-provided iconv
- Coverity flavored clang analyzer fixes
- tests: verify adding index conflicts with invalid filemodes fails
- worktree: unlock should return 1 when the worktree isn't locked
- Add a fuzzer for config files
- Fix 'invalid packet line' for ng packets containing errors
- Fix leak in index.c
- threads::diff: use separate git_repository objects
- travis: remove Coverity cron job
- parse: Do not initialize the content in context to NULL
- config_file: Don't crash on options without a section
- ci: Correct the status code check so Coverity doesn't force-fail Travis
- ci: remove appveyor
- diff: fix OOM on AIX when finding similar deltas in empty diff
- travis: do not execute Coverity analysis for all cron jobs
- ci: enable compilation with "-Werror"
- smart_pkt: fix potential OOB-read when processing ng packet
- Fix a double-free in config parsing
- Fuzzers
- ci: run VSTS builds on master and maint branches
- Windows: default credentials / fallback credential handling
- ci: add VSTS build badge to README
- ci: set PKG_CONFIG_PATH for travis
- CI: Refactor and introduce VSTS builds
- revwalk: remove tautologic condition for hiding a commit
- winhttp: retry erroneously failing requests
- Add a configurable limit to the max pack size that will be indexed
- mbedtls: remove unused variable "cacert"
- Squash some leaks
- Add a checkout example
- Assorted Coverity fixes
- Remove GIT_PKT_PACK entirely
-
ignore: improve
git_ignore_path_is_ignored
description Git analogy - alloc: don't overwrite allocator during init if set
- C90 standard compliance
- Delta OOB access
- Release v0.27.3
- streams: report OpenSSL errors if global init fails
- patch_parse: populate line numbers while parsing diffs
- Fix git_worktree_validate failing on bare repositories
- git_refspec_transform: Handle NULL dst
- Add a "dirty" state to the index when it has unsaved changes
-
refspec: rename
git_refspec__free
togit_refspec__dispose
- streams: openssl: Handle error in SSL_CTX_new
- refspec: add public parsing api
- Fix interaction between limited flag and sorting over resets
- deps: fix implicit fallthrough warning in http-parser
- Fix assorted leaks found via fuzzing
- Fix type confusion in git_smart__connect
- Verify ref_pkt's are long enough
- Config parser cleanups
- Fix last references to deprecated git_buf_free
- revwalk: avoid walking the entire history when output is unsorted
- Add mailmap support.
- tree: remove unused functions
-
Link
mbedTLS
libraries in whenSHA1_BACKEND
== "mbedTLS" - editorconfig: allow trailing whitespace in markdown
- docs: fix statement about tab width
- diff: fix enum value being out of allowed range
-
pack: rename
git_packfile_stream_free
- Stop leaking the memory
- Bugfix release v0.27.2
- Fix stash save bug with fast path index check
-
path: unify
git_path_is_*
APIs - Fix negative gitignore rules with leading directories
- Custom memory allocators
- index: Fix alignment issues in write_disk_entry()
- travis: war on leaks
- refdb_fs: fix regression: failure when globbing for non-existant references
- tests: submodule: do not rely on config iteration order
- Detect duplicated submodules for the same path
- Fix docurium missing includes
- github: update issue template
- streams: openssl: add missing check on OPENSSL_LEGACY_API
- mbedtls: don't require mbedtls from our pkgconfig file
- Fixes for CVE 2018-11235
- Backport fixes for CVE 2018-11235
- Added note about Windows junction points to the differences from git document
- cmake: resolve libraries found by pkg-config
- refdb_fs: enhance performance of globbing
- global: adjust init count under lock
- Fix GCC 8.1 warnings
- Worktrees can be made from bare repositories
- docs: add documentation to state differences from the git cli
- Sanitize the hunk header to ensure it contains UTF-8 valid data
- examples: ls-files: add ls-files to list paths in the index
- OpenSSL legacy API cleanups
- worktree: add functions to get name and path
- Fix deletion of unrelated branch on worktree
- mbedTLS support
- Configuration entry iteration in order
- blame_git: fix coalescing step never being executed
- Fix leaks in master
- Leak fixes for v0.27.1
- worktree: Read worktree specific reflog for HEAD
- fixed stack smashing due to wrong size of struct stat on the stack
- scripts: add backporting script
- worktree: add ability to create worktree with pre-existing branch
- refs: preserve the owning refdb when duping reference
- Submodules-API should report .gitmodules parse errors instead of ignoring them
- Typedef git_pkt_type and clarify recv_pkt return type
- online::clone: validate user:pass in HTTP_PROXY
- transports: ssh: disconnect session before freeing it
- revwalk: fix uninteresting revs sometimes not limiting graphwalk
- attr_file: fix handling of directory patterns with trailing spaces
- transports: local: fix assert when fetching into repo with symrefs
- remote/proxy: fix git_transport_certificate_check_db description
- Flag options in describe.h as being optional
- diff: Add missing GIT_DELTA_TYPECHANGE -> 'T' mapping.
- appveyor: fix typo in registry key to disable DHE
- Fix build with LibreSSL 2.7
- appveyor: workaround for intermittent test failures
- sha1dc: update to fix errors with endianess
- submodule: check index for path and prefix before adding submodule
- odb: mempack: fix leaking objects when freeing mempacks
- types: remove unused git_merge_result
- checkout: change default strategy to SAFE
- Add myself to git.git-authors