libgit2 v0.24.0 RC1 发布
libgit2 v0.24.0 RC1 发布,该版本包含众多变化,详细列表包括:
Changes or improvements
Custom filters can now be registered with wildcard attributes, for
examplefilter=*. Consumers should examine the attributes parameter
of thecheckfunction 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
using theGIT_OPT_SET_USER_AGENTwithgit_libgit2_opts().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
registration.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
repository's workdir.
API additions
git_config_lock()has 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.git_diff_optionsadded a new callbackprogress_cbto report on the
progress of the diff as files are being compared. The documentation of
the existing callbacknotify_cbwas updated to reflect that it only
gets called when new deltas are added to the diff.git_fetch_optionsandgit_push_optionshave gained acustom_headers
field to set the extra HTTP header fields to send.git_stream_register_tls()lets you register a callback to be used
as the constructor for a TLS stream instead of the libgit2 built-in
one.git_commit_header_field()allows you to look up a specific header
field in a commit.git_commit_extract_signature()extracts the signature from a
commit and gives you both the signature and the signed data so you
can verify it.
API removals
There were no API removals in this release.
Breaking API changes
The
git_merge_tree_flag_tis nowgit_merge_flag_t. Subsequently,
its members are no longer prefixed withGIT_MERGE_TREE_FLAGbut are
now prefixed withGIT_MERGE_FLAG, and thetree_flagsfield of the
git_merge_optionsstructure is now namedflags.The
git_merge_file_flags_tenum is nowgit_merge_file_flag_tfor
consistency with other enum type names.git_certdescendent types now have a properparentmemberIt 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.git_config_backendhas gained two entries.lockandunlock
with which to implement the transactional/atomic semantics for the
configuration backend.git_index_addandgit_index_conflict_add()will 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-levelgit_index_add_bypathor
git_index_add_frombufferfunctions.The
notify_payloadfield ofgit_diff_optionswas renamed topayload
to reflect that it's also the payload for the new progress callback.The
git_config_level_tenum has gained a higher-priority value
GIT_CONFIG_LEVEL_PROGRAMDATAwhich represent a rough Windows equivalent
to the system level configuration.git_rebase_init()not also takes a merge options.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.