Skip to content

Releases: libgit2/libgit2

libgit2 v0.21.0 RC1

08 Jun 16:40
@vmg vmg
Compare
Choose a tag to compare
libgit2 v0.21.0 RC1 Pre-release
Pre-release

Hello and welcome to a release candidate for libgit2. This is something new for us because we've never tagged a RC before but:

  1. We haven't shipped a release in a long ass time
  2. The current tip of development is not as stable as I'd like it to be

Hence, a release candidate. The tip of development will be frozen to bugfixes only until we tag the final version. Please play with it and make sure we're good.

Here are the current release notes, which I've updated to the best of my ability:

  • Top-level Improvements
    • We've dropped support for Windows XP. We're evil like that.
    • Added a new config snapshotting API to fix race issues when different applications (e.g. Git and a libgit2 client) access the same repository simultaneously.
    • Added reflog support to all APIs that could alter a reference. These APIs gained two new parameters: const git_signature *signature and const char *log_message to control what is written to the reflog. Passing NULL for these values will use defaults from the user's configuration.
    • Avoided race conditions when updating references. Any function that alters a reference will check if the underlying reference data has been changed since libgit2 looked up the data and cancel the operation with error GIT_EMODIFIED if the reference has been changed.
    • Converted all APIs that output string data to use git_buf objects for the return value. Previously these would typically take a pointer to an output buffer and a size, and generate an error if the output buffer was not large enough.
    • Added standard git_<object>_init_options functions to initialize options structures when static initialization is not possible, and renamed options structures to standard git_<object>_options (replacing _opts suffix used in some places)
    • Improved use of const on pointers in many APIs (which may affect some bindings).
    • Replaced use of oid with simply id for references to git_oid value.s
    • Previously, when a callback function returned an error value (i.e. non-zero), libgit2 converted it to GIT_EUSER for the parent function's return value. Now, libgit2 tries to pass through the callback's return value all the way back to the caller. To disambiguate between an error generated by the callback vs. an error generated internally by libgit2, a callback can still explicitly return the GIT_EUSER value -- libgit2 will never use that error code for errors that it raises.
    • All inline functions were eliminated from the public libgit2 API
    • Removed all Apache licensed code from library
    • CRLF handling is much improved in the platforms where it matters (Windows)
  • Attributes
    • Improved compatability with core Git for filename patterns including support for ** matches
    • Cache validation improvements
    • Faster attribute checks
  • Blame
    • Added GIT_BLAME_FIRST_PARENT to simplify search
  • Clone
    • Local clones are now supported. Rejoice!
  • Checkout
    • Added ability to write out conflict data using either MERGE or DIFF3 style
    • Improved support for core.autocrlf and core.safecrlf
    • Improved handling of empty and ignored directories (impacts git_reset APIs, too)
  • Cherry Pick
    • Completely new API
    • New API: git_cherry_pick_commit generates a new git_index * with result
    • New API: git_cherry_pick updates existing index and working directory
  • Commit
    • Faster commit parsing
    • New API: git_commit_summary returns first paragraph of commit message with whitespace trimmed and squashed
    • New API: git_commit_amend creates a new commit that is a clone of an existing commit with selected fields overwritten
    • New API: git_commit_create_from_callback allows creating a new commit using a callback to provide parent information (in include/git2/sys/commit.h)
    • When given a reference to update, git_commit_create now checks that the first parent is the current value of said reference and checks that the old value of the reference is correct when updating it.
    • The comment character can now be specified when parsing commit messages.
  • Diff
    • Faster diffs due to reduced calculation of SHAs for unknown files on disk
    • Added flag GIT_DIFF_UPDATE_INDEX to optionally update the index stat cache while performing index-to-workdir diffs. This can yield performance improvements when doing repeated diffs (or status checks)
    • Added support for builtin diff drivers that is compatible (and derived from) core Git (e.g. setting attribute "*.html diff=html" will now change diff output in libgit2, whereas previously the "html" diff driver was not internally defined)
    • git_diff_find_similar will now fall back to the diff.renames config setting if no explicit options are passed in
    • git_diff_find_similar gained GIT_DIFF_FIND_REMOVE_UNMODIFIED flag to remove GIT_DELTA_UNMODIFIED records from a diff after rename detection is done. This allows you to generate a diff that includes UNMODIFIED records (so they can be considered as possible sources for COPIED files) and then remove unused ones from the final diff.
    • New API: git_diff_buffers runs diff on two in-memory buffers
    • New API: git_diff_get_stats creates git_diff_stats to emulate --stat, --numstat, and --shortstat output
    • New API: git_diff_stats_free to free git_diff_stats object
    • New API: git_diff_stats_to_buf outputs git_diff_stats in formats like Git
    • New APIs: git_diff_stats_files_changed, git_diff_stats_insertions, and git_diff_stats_deletions are accessors for git_diff_stats object
    • New API: git_diff_format_email to generate an email patch (in a git_buf) from a git_diff using git_diff_format_email_options settings
    • New API: git_diff_commit_as_email to generate an email-ready patch from a git_commit
    • New API: git_diff_print_callback__to_buf helper function for use with git_diff_print and git_patch_print to accumulate output into a git_buf * (in include/git2/sys/diff.h)
    • New API: git_diff_print_callback__to_file_handle helper function for use with git_diff_print and git_patch_print to send output to a FILE * (in include/git2/sys/diff.h)
    • New API: git_diff_get_perfdata gets low-level performance data for a git_diff (in include/git2/sys/diff.h)
  • Errors
    • New error code: GIT_EMODIFIED returned when a reference-modifying operation finds that the underlying reference was changed underneath the libgit2 call
  • Graph
    • New API: git_graph_descendant_of checks if one commit is the descendant of another
  • Ignores
    • Lots of bug fixes
    • Improved compatability with core Git for filename patterns including support for ** matches
    • Cache validation improvements
  • Index
    • The index no longer allows tree and blob path collisions.
  • Mempack
    • Completely new API (in include/git2/sys/mempack.h)
    • Custom ODB backend to pack objects in memory
  • Merge
    • Major changes to how the Merge APIs work
    • git_merge previously produced a new commit, now stages a new commit, including writing conflicts to the index and working tree; has new function signature.
    • New API: git_merge_analysis checks if an array of merge heads can be merged, fast-forwarded, are up-to-date, or otherwise
    • New API: git_merge_base_octopus finds a merge base for an octopus merge
    • New API: git_merge_head_id returns the commit id that a git_merge_head object refers to
    • New API: git_merge_commits merges two commits and generates new index representing merge result
    • New API: git_merge_file merges two files in memory, producing a git_merge_file_result object
    • New API: git_merge_file_from_index merges two index entries in memory, producing a git_merge_file_result object
    • New API: git_merge_file_result_free frees an git_merge_file_result object
  • Object
    • New API: git_object_short_id returns unambiguous abbreviated ID string for object
  • ODB
    • New API: git_odb_exists_prefix checks for existence of object by partial git_oid
  • Pack
    • New API: git_packbuilder_write_buf writes packfile to git_buf * in memory
    • Delta resolution now happens iteratively instead of recursively, so no more stack overflows.
    • Deflate buffer usage is now more efficient
  • Patch
    • New API: git_patch_from_buffers creates git_patch object from the diff of two in-memory buffers
    • Added support for deflated binary patches.
  • References
    • New API: git_reference_create_matching safely creates a direct reference to update from an expected old const git_oid * value
    • New API: git_reference_symbolic_create_matching safely creates a symbolic reference to update from an expected old const char * value
    • New API: git_reference_remove removes a reference by name
    • New API: git_reference_ensure_log makes sure there is a log file for a reference
    • New API: git_reference_is_note checks if reference lives in refs/notes namespace
  • Remotes
    • New API: git_remote_dup copies an existing remote (except for callback functions)
    • New API: git_remote_get_callbacks gets callbacks struct from existing remote
  • Revert
    • Completely new API
    • New API: git_revert_commit generates new git_index with result of reverting commit
    • New API: git_revert reverts commit in working directory
  • Revwalk
    • APIs that previous tooks commits or references to commits can now take a "committish" (i.e. tags will be peeled to reach a commit)
    • git_revwalk_{push,hide}_glob now ignores a reference if it is not a commitish instead of erroring out.
    • New API: git_revwalk_add_hide_cb enables callback to make decisions about hiding commits during a revwalk
  • Status
    • Faster status due to reduced calculation of SHAs for unknown files on disk
    • Added flag GIT_STATUS_OPT_UPDATE_INDEX to optionally update the index stat cache while performing status. This can yield performance improvement...
Read more

libgit2 v0.20.0 "Anmeldung"

20 Nov 12:01
@vmg vmg
Compare
Choose a tag to compare
Pre-release

Apologies for the delay. This release is chunky, but you're probably used to chunky releases by now.

Full changelog follows:

Internal changes

  • Added support for decomposed Unicode paths in Mac OS X
  • Added support for junctions in win32
  • Fixed issues with HTTP redirects in the network stack
  • Performance improvements (as always)

git2/blame.h

  • added full support for blame operations

git2/blob.h

  • added git_blob_filtered_content to load blobs in memory with their corresponding filters applied

git2/branch.h

  • added branch iterators as an alternative to the callback-based API

git2/buffer.h

  • exported the git_buf struct to allow binary buffers to be passed from/to the library. This simplifies several APIs

git2/checkout.h

  • implemented additional checkout options ('skip unmerged', 'use ours' and 'use theirs')

git2/clone.h

  • simplified the clone API
  • added new git_clone_into to clone into an existing (empty) repository

git2/commit.h

  • added APIs to access the raw (uncleaned) text of a commit message

git2/common.h

  • added global options to set the default paths to load templates from

git2/config.h

  • added multivar iterators
  • added globbing iterator
  • added git_config_foreach_match to perform operations on every single var in a config file

git2/diff.h

  • restructured and simplified the diff API

git2/filter.h

  • added external APIs to configure and apply custom filters to checked out blobs

git2/index.h

  • git_index_read can now force a reload of the index file even if it hasn't changed on-disk

git2/indexer.h

  • improved the streaming indexer APIs

git2/merge.h

  • added support for merge!

git2/object.h

  • added helper API to lookup a generic object by path

git2/pack.h

  • added progress callbacks to the packbuilder

git2/patch.h

  • added support for patch generation as part of the Diff API revamp

git2/pathspec.h

  • added helper APIs to work with pathspecs and match files in the workdir or diffs

git2/push.h

  • added progress callbacks to push

git2/reflog.h

  • changed reflog APIs to work on reference names instead of the references themselves, so they become less racy

git2/remote.h

  • added support for setting refspecs on remotes, either at creation or on existing ones
  • simplified the remotes API

git2/revwalk.h

  • add API to simplify parents during a walk

git2/signature.h

  • add helper to create a signature with the default values for a repository (i.e. the set user.name and user.email values, and the current time)

git2/submodules.h

  • improve the status detection for submodules

git2/sys/

  • exported many new internal APIs, such as pluggabe transport APIs

vmg, out

v0.19.0

03 Jul 16:21
@ben ben
Compare
Choose a tag to compare
v0.19.0 Pre-release
Pre-release

Minor point release! We got a lot of rather large features that we
wanted to get settled in:

  • New (threadsafe) cache for objects
  • Iterator for Status
  • New Merge APIs
  • SSH support on *NIX
  • Function context on diff
  • Namespaces support
  • Index add/update/remove with wildcard support
  • Iterator for References
  • Fetch and push refspecs for Remotes
  • Rename support in Status
  • New 'sys/` namespace for external headers with low-level APIs

As always, this comes with hundreds of bug fixes and performance
improvements. We're faster and better than ever. And we haven't broken
many APIs this time!

Build stuff.

libgit2 0.18.0 "Big Ben"

03 Jul 16:19
@ben ben
Compare
Choose a tag to compare
Pre-release

This is the last minor release before 1.0preview1.

Highlights of this release include:

  • Branch API
  • Checkout head, index and tree
  • Finished clone support
  • Abstracted reference API to use custom backends
  • Full diff support
  • New (faster) packbuilder
  • Push support
  • New Remotes API
  • Revparse support (single and range commits)
  • Stash support
  • Submodules support

As always, the full changelog is available at http://libgit2.github.com/libgit2/#p/changelog.

Yeah, it's a huge release. Releasing stuff sucks.
Expect 1.0 and API freeze in less than a month.

Your faithful maintainer,
vmg