Skip to content

Releases: libgit2/libgit2

libgit2 v0.21.5 Maintenance Release

20 Jan 23:30
Compare
Choose a tag to compare

The following (critical) fixes have been backported to this maintenance release.
All users of the library are encouraged to update.

  • af769f4 checkout: introduce git_checkout_perfdata
  • fc478d2 git_path_join_unrooted: return base len
  • 629a579 checkout: don't recreate previous directory
  • dd3c53f checkout tests: nasty symlinks
  • 186177a checkout: drop newline in error message
  • 7268a5a checkout: remove files before writing new ones
  • e517b62 checkout tests: emulate p_realpath poorly on Win32
  • 9a8753d checkout tests: cleanup realpath impl on Win32
  • 8433078 Introduce test for checkout case-changing rename
  • d853fb9 Always checkout with case sensitive iterator

libgit2 v0.22

13 Jan 18:21
Compare
Choose a tag to compare

This is the first release of the v0.22 series, "Las Canteras", with many fixes and new features since v0.21. The changelog follows.

Changes or improvements

  • git_signature_new() now requires a non-empty email address.
  • Use CommonCrypto libraries for SHA-1 calculation on Mac OS X.
  • Disable SSL compression and SSLv2 and SSLv3 ciphers in favor of TLSv1
    in OpenSSL.
  • The fetch behavior of remotes with autotag set to GIT_REMOTE_DOWNLOAD_TAGS_ALL
    has been changed to match git 1.9.0 and later. In this mode, libgit2 now
    fetches all tags in addition to whatever else needs to be fetched.
  • git_checkout() now handles case-changing renames correctly on
    case-insensitive filesystems; for example renaming "readme" to "README".
  • The search for libssh2 is now done via pkg-config instead of a
    custom search of a few directories.
  • Add support for core.protectHFS and core.protectNTFS. Add more
    validation for filenames which we write such as references.
  • The local transport now generates textual progress output like
    git-upload-pack does ("counting objects").
  • git_checkout_index() can now check out an in-memory index that is not
    necessarily the repository's index, so you may check out an index
    that was produced by git_merge and friends while retaining the cached
    information.
  • Remove the default timeout for receiving / sending data over HTTP using
    the WinHTTP transport layer.
  • Add SPNEGO (Kerberos) authentication using GSSAPI on Unix systems.
  • Provide built-in objects for the empty blob (e69de29) and empty
    tree (4b825dc) objects.
  • The index' tree cache is now filled upon read-tree and write-tree
    and the cache is written to disk.
  • LF -> CRLF filter refuses to handle mixed-EOL files
  • LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)
  • File unlocks are atomic again via rename. Read-only files on Windows are
    made read-write if necessary.
  • Share open packfiles across repositories to share descriptors and mmaps.
  • Use a map for the treebuilder, making insertion O(1)
  • The build system now accepts an option EMBED_SSH_PATH which when set
    tells it to include a copy of libssh2 at the given location. This is
    enabled for MSVC.
  • Add support for refspecs with the asterisk in the middle of a
    pattern.
  • Fetching now performs opportunistic updates. To achieve this, we
    introduce a difference between active and passive refspecs, which
    make git_remote_download() and git_remote_fetch() to take a list of
    resfpecs to be the active list, similarly to how git fetch accepts a
    list on the command-line.
  • The THREADSAFE option to build libgit2 with threading support has
    been flipped to be on by default.
  • The remote object has learnt to prune remote-tracking branches. If
    the remote is configured to do so, this will happen via
    git_remote_fetch(). You can also call git_remote_prune() after
    connecting or fetching to perform the prune.

API additions

  • Introduce git_buf_text_is_binary() and git_buf_text_contains_nul() for
    consumers to perform binary detection on a git_buf.
  • git_branch_upstream_remote() has been introduced to provide the
    branch..remote configuration value.
  • Introduce git_describe_commit() and git_describe_workdir() to provide
    a description of the current commit (and working tree, respectively)
    based on the nearest tag or reference
  • Introduce git_merge_bases() and the git_oidarray type to expose all
    merge bases between two commits.
  • Introduce git_merge_bases_many() to expose all merge bases between
    multiple commits.
  • Introduce rebase functionality (using the merge algorithm only).
    Introduce git_rebase_init() to begin a new rebase session,
    git_rebase_open() to open an in-progress rebase session,
    git_rebase_commit() to commit the current rebase operation,
    git_rebase_next() to apply the next rebase operation,
    git_rebase_abort() to abort an in-progress rebase and git_rebase_finish()
    to complete a rebase operation.
  • Introduce git_note_author() and git_note_committer() to get the author
    and committer information on a git_note, respectively.
  • A factory function for ssh has been added which allows to change the
    path of the programs to execute for receive-pack and upload-pack on
    the server, git_transport_ssh_with_paths().
  • The ssh transport supports asking the remote host for accepted
    credential types as well as multiple challeges using a single
    connection. This requires to know which username you want to connect
    as, so this introduces the USERNAME credential type which the ssh
    transport will use to ask for the username.
  • The GIT_EPEEL error code has been introduced when we cannot peel a tag
    to the requested object type; if the given object otherwise cannot be
    peeled, GIT_EINVALIDSPEC is returned.
  • Introduce GIT_REPOSITORY_INIT_RELATIVE_GITLINK to use relative paths
    when writing gitlinks, as is used by git core for submodules.
  • git_remote_prune() has been added. See above for description.
  • Introduce reference transactions, which allow multiple references to
    be locked at the same time and updates be queued. This also allows
    us to safely update a reflog with arbitrary contents, as we need to
    do for stash.

API removals

  • git_remote_supported_url() and git_remote_is_valid_url() have been
    removed as they have become essentially useless with rsync-style ssh paths.
  • git_clone_into() and git_clone_local_into() have been removed from the
    public API in favour of git_clone callbacks.
  • The option to ignore certificate errors via git_remote_cert_check()
    is no longer present. Instead, git_remote_callbacks has gained a new
    entry which lets the user perform their own certificate checks.

Breaking API changes

  • git_cherry_pick() is now git_cherrypick().

  • The git_submodule_update() function was renamed to
    git_submodule_update_strategy(). git_submodule_update() is now used to
    provide functionalty similar to "git submodule update".

  • git_treebuilder_create() was renamed to git_treebuilder_new() to better
    reflect it being a constructor rather than something which writes to
    disk.

  • git_treebuilder_new() (was git_treebuilder_create()) now takes a
    repository so that it can query repository configuration.
    Subsequently, git_treebuilder_write() no longer takes a repository.

  • git_threads_init() and git_threads_shutdown() have been renamed to
    git_libgit2_init() and git_libgit2_shutdown() to better explain what
    their purpose is, as it's grown to be more than just about threads.

  • git_libgit2_init() and git_libgit2_shutdown() now return the number of
    initializations of the library, so consumers may schedule work on the
    first initialization.

  • The git_transport_register() function no longer takes a priority and takes
    a URL scheme name (eg "http") instead of a prefix like "http://"

  • git_index_name_entrycount() and git_index_reuc_entrycount() now
    return size_t instead of unsigned int.

  • The context_lines and interhunk_lines fields in git_diff_options are
    now uint32_t instead of uint16_t. This allows to set them to UINT_MAX,
    in effect asking for "infinite" context e.g. to iterate over all the
    unmodified lines of a diff.

  • git_status_file() now takes an exact path. Use git_status_list_new() if
    pathspec searching is needed.

  • git_note_create() has changed the position of the notes reference
    name to match git_note_remove().

  • Rename git_remote_load() to git_remote_lookup() to bring it in line
    with the rest of the lookup functions.

  • git_remote_rename() now takes the repository and the remote's
    current name. Accepting a remote indicates we want to change it,
    which we only did partially. It is much clearer if we accept a name
    and no loaded objects are changed.

  • git_remote_delete() now accepts the repository and the remote's name
    instead of a loaded remote.

  • git_merge_head is now git_annotated_commit, to better reflect its usage
    for multiple functions (including rebase)

  • The git_clone_options struct no longer provides the ignore_cert_errors or
    remote_name members for remote customization.

    Instead, the git_clone_options struct has two new members, remote_cb and
    remote_cb_payload, which allow the caller to completely override the remote
    creation process. If needed, the caller can use this callback to give their
    remote a name other than the default (origin) or disable cert checking.

    The remote_callbacks member has been preserved for convenience, although it
    is not used when a remote creation callback is supplied.

  • The git_clone_options struct now provides repository_cb and
    repository_cb_payload to allow the user to create a repository with
    custom options.

  • The git_push struct to perform a push has been replaced with
    git_remote_upload(). The refspecs and options are passed as a
    function argument. git_push_update_tips() is now also
    git_remote_update_tips() and the callbacks are in the same struct as
    the rest.

  • The git_remote_set_transport() function now sets a transport factory function,
    rather than a pre-existing transport instance.

  • The git_transport structure definition has moved into the sys/transport.h
    file.

  • libgit2 no longer automatically sets the OpenSSL locking
    functions. This is not something which we can know to do. A
    last-resort convenience function is provided in sys/openssl.h,
    git_openssl_set_locking() which can be used to set the locking.

libgit2 v0.22.0 RC2

09 Jan 23:56
Compare
Choose a tag to compare
libgit2 v0.22.0 RC2 Pre-release
Pre-release

This is the second release candidate for libgit2 v0.22.0. There's been a couple of memory fixes since the first candidate, but nothing major. The release seems to be shaping up nicely.

The changelog follows

Changes or improvements

  • git_signature_new() now requires a non-empty email address.
  • Use CommonCrypto libraries for SHA-1 calculation on Mac OS X.
  • Disable SSL compression and SSLv2 and SSLv3 ciphers in favor of TLSv1
    in OpenSSL.
  • The fetch behavior of remotes with autotag set to GIT_REMOTE_DOWNLOAD_TAGS_ALL
    has been changed to match git 1.9.0 and later. In this mode, libgit2 now
    fetches all tags in addition to whatever else needs to be fetched.
  • git_checkout() now handles case-changing renames correctly on
    case-insensitive filesystems; for example renaming "readme" to "README".
  • The search for libssh2 is now done via pkg-config instead of a
    custom search of a few directories.
  • Add support for core.protectHFS and core.protectNTFS. Add more
    validation for filenames which we write such as references.
  • The local transport now generates textual progress output like
    git-upload-pack does ("counting objects").
  • git_checkout_index() can now check out an in-memory index that is not
    necessarily the repository's index, so you may check out an index
    that was produced by git_merge and friends while retaining the cached
    information.
  • Remove the default timeout for receiving / sending data over HTTP using
    the WinHTTP transport layer.
  • Add SPNEGO (Kerberos) authentication using GSSAPI on Unix systems.
  • Provide built-in objects for the empty blob (e69de29) and empty
    tree (4b825dc) objects.
  • The index' tree cache is now filled upon read-tree and write-tree
    and the cache is written to disk.
  • LF -> CRLF filter refuses to handle mixed-EOL files
  • LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)
  • File unlocks are atomic again via rename. Read-only files on Windows are
    made read-write if necessary.
  • Share open packfiles across repositories to share descriptors and mmaps.
  • Use a map for the treebuilder, making insertion O(1)
  • The build system now accepts an option EMBED_SSH_PATH which when set
    tells it to include a copy of libssh2 at the given location. This is
    enabled for MSVC.
  • Add support for refspecs with the asterisk in the middle of a
    pattern.
  • Fetching now performs opportunistic updates. To achieve this, we
    introduce a difference between active and passive refspecs, which
    make git_remote_download() and git_remote_fetch() to take a list of
    resfpecs to be the active list, similarly to how git fetch accepts a
    list on the command-line.
  • The THREADSAFE option to build libgit2 with threading support has
    been flipped to be on by default.
  • The remote object has learnt to prune remote-tracking branches. If
    the remote is configured to do so, this will happen via
    git_remote_fetch(). You can also call git_remote_prune() after
    connecting or fetching to perform the prune.

API additions

  • Introduce git_buf_text_is_binary() and git_buf_text_contains_nul() for
    consumers to perform binary detection on a git_buf.
  • git_branch_upstream_remote() has been introduced to provide the
    branch..remote configuration value.
  • Introduce git_describe_commit() and git_describe_workdir() to provide
    a description of the current commit (and working tree, respectively)
    based on the nearest tag or reference
  • Introduce git_merge_bases() and the git_oidarray type to expose all
    merge bases between two commits.
  • Introduce git_merge_bases_many() to expose all merge bases between
    multiple commits.
  • Introduce rebase functionality (using the merge algorithm only).
    Introduce git_rebase_init() to begin a new rebase session,
    git_rebase_open() to open an in-progress rebase session,
    git_rebase_commit() to commit the current rebase operation,
    git_rebase_next() to apply the next rebase operation,
    git_rebase_abort() to abort an in-progress rebase and git_rebase_finish()
    to complete a rebase operation.
  • Introduce git_note_author() and git_note_committer() to get the author
    and committer information on a git_note, respectively.
  • A factory function for ssh has been added which allows to change the
    path of the programs to execute for receive-pack and upload-pack on
    the server, git_transport_ssh_with_paths().
  • The ssh transport supports asking the remote host for accepted
    credential types as well as multiple challeges using a single
    connection. This requires to know which username you want to connect
    as, so this introduces the USERNAME credential type which the ssh
    transport will use to ask for the username.
  • The GIT_EPEEL error code has been introduced when we cannot peel a tag
    to the requested object type; if the given object otherwise cannot be
    peeled, GIT_EINVALIDSPEC is returned.
  • Introduce GIT_REPOSITORY_INIT_RELATIVE_GITLINK to use relative paths
    when writing gitlinks, as is used by git core for submodules.
  • git_remote_prune() has been added. See above for description.
  • Introduce reference transactions, which allow multiple references to
    be locked at the same time and updates be queued. This also allows
    us to safely update a reflog with arbitrary contents, as we need to
    do for stash.

API removals

  • git_remote_supported_url() and git_remote_is_valid_url() have been
    removed as they have become essentially useless with rsync-style ssh paths.
  • git_clone_into() and git_clone_local_into() have been removed from the
    public API in favour of git_clone callbacks.
  • The option to ignore certificate errors via git_remote_cert_check()
    is no longer present. Instead, git_remote_callbacks has gained a new
    entry which lets the user perform their own certificate checks.

Breaking API changes

  • git_cherry_pick() is now git_cherrypick().

  • The git_submodule_update() function was renamed to
    git_submodule_update_strategy(). git_submodule_update() is now used to
    provide functionalty similar to "git submodule update".

  • git_treebuilder_create() was renamed to git_treebuilder_new() to better
    reflect it being a constructor rather than something which writes to
    disk.

  • git_treebuilder_new() (was git_treebuilder_create()) now takes a
    repository so that it can query repository configuration.
    Subsequently, git_treebuilder_write() no longer takes a repository.

  • git_threads_init() and git_threads_shutdown() have been renamed to
    git_libgit2_init() and git_libgit2_shutdown() to better explain what
    their purpose is, as it's grown to be more than just about threads.

  • git_libgit2_init() and git_libgit2_shutdown() now return the number of
    initializations of the library, so consumers may schedule work on the
    first initialization.

  • The git_transport_register() function no longer takes a priority and takes
    a URL scheme name (eg "http") instead of a prefix like "http://"

  • git_index_name_entrycount() and git_index_reuc_entrycount() now
    return size_t instead of unsigned int.

  • The context_lines and interhunk_lines fields in git_diff_options are
    now uint32_t instead of uint16_t. This allows to set them to UINT_MAX,
    in effect asking for "infinite" context e.g. to iterate over all the
    unmodified lines of a diff.

  • git_status_file() now takes an exact path. Use git_status_list_new() if
    pathspec searching is needed.

  • git_note_create() has changed the position of the notes reference
    name to match git_note_remove().

  • Rename git_remote_load() to git_remote_lookup() to bring it in line
    with the rest of the lookup functions.

  • git_remote_rename() now takes the repository and the remote's
    current name. Accepting a remote indicates we want to change it,
    which we only did partially. It is much clearer if we accept a name
    and no loaded objects are changed.

  • git_remote_delete() now accepts the repository and the remote's name
    instead of a loaded remote.

  • git_merge_head is now git_annotated_commit, to better reflect its usage
    for multiple functions (including rebase)

  • The git_clone_options struct no longer provides the ignore_cert_errors or
    remote_name members for remote customization.

    Instead, the git_clone_options struct has two new members, remote_cb and
    remote_cb_payload, which allow the caller to completely override the remote
    creation process. If needed, the caller can use this callback to give their
    remote a name other than the default (origin) or disable cert checking.

    The remote_callbacks member has been preserved for convenience, although it
    is not used when a remote creation callback is supplied.

  • The git_clone_options struct now provides repository_cb and
    repository_cb_payload to allow the user to create a repository with
    custom options.

  • The git_push struct to perform a push has been replaced with
    git_remote_upload(). The refspecs and options are passed as a
    function argument. git_push_update_tips() is now also
    git_remote_update_tips() and the callbacks are in the same struct as
    the rest.

  • The git_remote_set_transport() function now sets a transport factory function,
    rather than a pre-existing transport instance.

  • The git_transport structure definition has moved into the sys/transport.h
    file.

  • libgit2 no longer automatically sets the OpenSSL locking
    functions. This is not something which we can know to do. A
    last-resort convenience function is provided in sys/openssl.h,
    git_openssl_set_locking() which can be used to set the locking.

libgit2 v0.21.4 Maintenance Release

13 Jan 18:21
Compare
Choose a tag to compare

The following fixes have been backported to this maintenance release. All users of the library are encouraged to update. This will be the last release in the v0.21 series.

  • bce9484 Fix assert when receiving uncommon sideband packet
  • 4f2d272 ignore: don't leak rules into higher directories
  • 8fce79b ignore: match git's rule negation rules
  • f888185 ignore: adjust test for negating inside a dir
  • 8de0f1e Merge pull request #2770 from tkelman/patch-1
  • b38fe6f Fix build of tests with mingw
  • 4058f1c Fix ming32 compilation
  • 04da236 Fix public header on sys/refs.h
  • dc39d23 Plug possible leak in the openssl locks
  • 3a2c60e ssl: clear the OpenSSL locking function
  • 9c04635 Fix segmentation fault observed on OpenBSD/sparc64

libgit2 v0.22.0 RC1

05 Jan 21:45
Compare
Choose a tag to compare
libgit2 v0.22.0 RC1 Pre-release
Pre-release

This is the first release candidate for libgit2 v0.22. From now on until the release we will only accept bugfixes for master.

Quite a few APIs have changed, but it seems that the rate is slowing down, even when there's so long between releases. The changelog follows

  • File unlocks are atomic again via rename. Read-only files on Windows are
    made read-write if necessary.

  • Share open packfiles across repositories to share descriptors and mmaps.

  • Use a map for the treebuilder, making insertion O(1)

  • Introduce reference transactions, which allow multiple references to
    be locked at the same time and updates be queued. This also allows
    us to safely update a reflog with arbitrary contents, as we need to
    do for stash.

  • The index' tree cache is now filled upon read-tree and write-tree
    and the cache is written to disk.

  • LF -> CRLF filter refuses to handle mixed-EOL files

  • LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)

  • The git_transport structure definition has moved into the sys/transport.h
    file.

  • The ssh transport supports asking the remote host for accepted
    credential types as well as multiple challeges using a single
    connection. This requires to know which username you want to connect
    as, so this introduces the USERNAME credential type which the ssh
    transport will use to ask for the username.

  • The build system now accepts an option EMBED_SSH_PATH which when set
    tells it to include a copy of libssh2 at the given location. This is
    enabled for MSVC.

  • libgit2 no longer automatically sets the OpenSSL locking
    functions. This is not something which we can know to do. A
    last-resort convenience function is provided in sys/openssl.h,
    git_openssl_set_locking() which can be used to set the locking.

  • The git_transport_register function no longer takes a priority and takes
    a URL scheme name (eg "http") instead of a prefix like "http://"

  • The git_remote_set_transport function now sets a transport factory function,
    rather than a pre-existing transport instance.

  • A factory function for ssh has been added which allows to change the
    path of the programs to execute for receive-pack and upload-pack on
    the server, git_transport_ssh_with_paths.

  • git_remote_rename() now takes the repository and the remote's
    current name. Accepting a remote indicates we want to change it,
    which we only did partially. It is much clearer if we accept a name
    and no loaded objects are changed.

  • git_remote_delete() now accepts the repository and the remote's name
    instead of a loaded remote.

  • git_remote_supported_url() has been removed as it has become
    essentially useless with rsync-style ssh paths.

  • The git_clone_options struct no longer provides the ignore_cert_errors or
    remote_name members for remote customization.

    Instead, the git_clone_options struct has two new members, remote_cb and
    remote_cb_payload, which allow the caller to completely override the remote
    creation process. If needed, the caller can use this callback to give their
    remote a name other than the default (origin) or disable cert checking.

    The remote_callbacks member has been preserved for convenience, although it
    is not used when a remote creation callback is supplied.

  • The git_clone_options struct now provides repository_cb and
    repository_cb_payload to allow the user to create a repository with
    custom options.

  • The option to ignore certificate errors via git_remote_cert_check()
    is no longer present. Instead, git_remote_callbacks has gained a new
    entry which lets the user perform their own certificate checks.

  • git_clone_into and git_clone_local_into have been removed from the
    public API in favour of git_clone callbacks

  • Add support for refspecs with the asterisk in the middle of a
    pattern.

  • Fetching now performs opportunistic updates. To achieve this, we
    introduce a difference between active and passive refspecs, which
    make git_remote_download and git_remote_fetch to take a list of
    resfpecs to be the active list, similarly to how git fetch accepts a
    list on the command-line.

  • Rename git_remote_load() to git_remote_lookup() to bring it in line
    with the rest of the lookup functions.

  • The git_push struct to perform a push has been replaced with
    git_remote_upload(). The refspecs and options are passed as a
    function argument. git_push_update_tips() is now also
    git_remote_update_tips() and the callbacks are in the same struct as
    the rest.

  • Introduce git_merge_bases() and the git_oidarray type to expose all
    merge bases between two commits.

  • Introduce git_merge_bases_many() to expose all merge bases between
    multiple commits.

  • git_merge_head is now git_annotated_commit, to better reflect its usage
    for multiple functions (including rebase)

  • Introduce rebase functionality (using the merge algorithm only).
    Introduce git_rebase_init() to begin a new rebase session,
    git_rebase_open() to open an in-progress rebase session,
    git_rebase_commit() to commit the current rebase operation,
    git_rebase_next() to apply the next rebase operation,
    git_rebase_abort() to abort an in-progress rebase and git_rebase_finish()
    to complete a rebase operation.

  • Introduce git_note_author() and git_note_committer() to get the author
    and committer information on a git_note, respectively.

  • git_note_create() has changed the position of the notes reference
    name to match git_note_remove().

  • The THREADSAFE option to build libgit2 with threading support has
    been flipped to be on by default.

  • The context_lines and interhunk_lines fields in git_diff_options are
    now uint32_t instead of uint16_t. This allows to set them to UINT_MAX,
    in effect asking for "infinite" context e.g. to iterate over all the
    unmodified lines of a diff.

  • git_status_file now takes an exact path. Use git_status_list_new if
    pathspec searching is needed.

  • The fetch behavior of remotes with autotag set to GIT_REMOTE_DOWNLOAD_TAGS_ALL
    has been changed to match git 1.9.0 and later. In this mode, libgit2 now
    fetches all tags in addition to whatever else needs to be fetched.

  • The remote object has learnt to prune remote-tracking branches. If
    the remote is configured to do so, this will happen via
    git_remote_fetch(). You can also call git_remote_prune() after
    connecting or fetching to perform the prune.

  • git_threads_init() and git_threads_shutdown() have been renamed to
    git_libgit2_init() and git_libgit2_shutdown() to better explain what
    their purpose is, as it's grown to be more than just about threads.

  • git_libgit2_init() and git_libgit2_shutdown() now return the number of
    initializations of the library, so consumers may schedule work on the
    first initialization.

  • git_treebuilder_new (was git_treebuilder_create) now takes a
    repository so that it can query repository configuration.
    Subsequently, git_treebuilder_write no longer takes a repository.

  • git_treebuilder_create was renamed to git_treebuilder_new to better
    reflect it being a constructor rather than something which writes to
    disk.

  • git_checkout now handles case-changing renames correctly on
    case-insensitive filesystems; for example renaming "readme" to "README".

  • git_index_name_entrycount() and git_index_reuc_entrycount() now
    return size_t instead of unsigned int.

  • The search for libssh2 is now done via pkg-config instead of a
    custom search of a few directories.

  • Add support for core.protectHFS and core.protectNTFS. Add more
    validation for filenames which we write such as references.

  • The local transport now generates textual progress output like
    git-upload-pack does ("counting objects").

  • The git_submodule_update function was renamed to
    git_submodule_update_strategy. git_submodule_update is now used to
    provide functionalty similar to "git submodule update".

libgit2 v0.21.3 Maintenance Release

18 Dec 21:13
Compare
Choose a tag to compare

The following (critical) fixes have been backported to this maintenance release. All users of the library are encouraged to update.

  • e476e7b index tests: test capitalization before mkdir
  • 90fad07 Plug leaks
  • 188ca62 Create miscapitialised dirs for case-sensitive filesystems
  • 88c8abf Bump version to 0.21.3
  • 2b37e33 Introduce core.protectHFS and core.protectNTFS
  • 581368f path: Use UTF8 iteration for HFS chars
  • 4320180 checkout: disallow bad paths on HFS
  • 8e7a957 reference_create: validate loose names
  • 9686c6b checkout: disallow bad paths on win32
  • 12db885 index: Check for valid paths before creating an index entry
  • 928429c tree: Check for .git with case insensitivy
  • 09361df win32: use NT-prefixed "?" paths
  • b5ee184 clar: wide character comparisons
  • c7e785b tests: use p_ instead of posix func directly

libgit2 v0.21.2 Maintenance Release

27 Oct 16:27
Compare
Choose a tag to compare

The following (critical) fixes have been backported to this maintenance release. All users of the library are encouraged to update.

  • 4af08d9 Bump version to 0.21.2
  • cc71348 global: clean up openssl_locks on shutdown
  • cb93013 config test: clean up memory leak
  • f4cb227 travis ci: build maint branches and development'
  • 5595287 Fixed memory leak in git_tag_delete()
  • 7881bab Patch from @carlosmn to refresh the parent config before snapshotting.
  • 1ebb8e9 Change the length of the file so that the change is picked up.
  • acbfce9 Add a test to make sure a new snapshot has the new value.
  • 635ba11 is_empty_dir (wi32): cope with empty mount points
  • b2fa95a p_lstat win32: don't canonicalize volume mounts
  • 01a1be3 Don't copy buffer in checkout unless needed
  • 46ef5a7 Ensure filters (i.e. CRLF) are applied when checking out conflict content
  • 6e41c27 Introduce failing test for conflict filtering in index
  • d055f4e repository_head_unborn: clear error when HEAD is unborn
  • 5757c02 ssl: dump the SSL ciphers in favour of TLS
  • 0571362 Silence unused return value warning
  • c02c530 Ensure patch is initialized to zero, otherwise, the allocated flag may be set
  • 6004658 Silence uninitialized warning
  • b933465 Fixed odb foreach test failure for big-endian 64-bit
  • 8a89bda Fixed merge REUC test for big-endian 64-bit
  • e8b6f55 The raw index buffer content is not guaranteed to be aligned
  • 55f72c1 Ensure pool data is aligned on an 8 byte boundary
  • f975fe9 Introduce GIT_ALIGN
  • 2f83bfc git_filter: dup the filter name
  • 68fce7f config: Fix multiple trailing spaces before comments not completely trimmed
  • a97157a When auto follow tags, FETCH_HEAD should list only newly followed tags
  • e023545 global: free the error message when exiting a thread
  • b593577 Correctly handle getaddrinfo return result
  • ba5cef0 Recurse ignored directories when stashing
  • 80ddaec Include git2/odb_backend.h in git2.h
  • c12bc32 Remove local unused index_repo variable
  • 9a8126e Only check for workdir conflicts if the index has merged files
  • edb2b83 Added test case to illustrate bogus conflicts detected if no files were merged, and untracked
  • c93d1eb ssh: store error message immediately after a failed agent call
  • ebee4d5 pack: return the correct final offset
  • b401dc9 git_remote_ls() should return an error if the transport is not available
  • 7d729d0 http: make sure we can consume the data we request
  • ea97190 config: a multiline var can start immediately

libgit2 v0.21.1 Maintenance Release

05 Aug 00:12
@vmg vmg
Compare
Choose a tag to compare

The following (critical) fixes have been backported to this maintenance release. All users of the library are encouraged to update.

  • b4d00c1 array: mark the array to grow as volatile
  • f3f9dc0 revwalk: remove preallocation of the uninteresting commits
  • 440a87a Add unit test to test add section without lf at EOF
  • 190fe07 Make sure \n is at the end of config file before a new section is written
  • ace6567 Properly report failure when expanding a packfile
  • f8b4093 refspec: support asterisks in the middle of a pattern
  • 0aa6b7e refspec: short-circuit non-pattern refspecs on transform
  • 18cf389 Include libssh2.h before git2.h (transport.h)
  • dbcb751 Fix git_cred_ssh_interactive_callback signature
  • 0e59463 netops: error out on url without a path
  • 12dcc6e ssh: libssh2_channel_write() behaves like send()
  • 38ddf22 Round up pool alloc sizes for alignment
  • 63ee946 ssh: always declare the libssh2 types
  • aa1b62b ssh: create the right callback signature based on build options
  • 1d43005 ssl: init only once without threads
  • 5838338 Merge pull request #2494 from libgit2/cmn/treebuilder-set-attribute
  • b692568 treebuilder: set the attributes before sorting and inserting

libgit2 v0.21.0

20 Jun 12:44
@vmg vmg
Compare
Choose a tag to compare

Final release of 0.21.0 after two release candidates. Go get it.

Changed since last version:

  • 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 improvements when doing repeated status checks.
    • New API: git_status_list_get_perfdata gets low-level performance data for a git_status_list (in include/git2/sys/diff.h)
  • Submodules
    • git_submodule objects are now reference counted and must be used with git_submodule_free when done
    • Submodules will now automatically refresh if the underlying data changes; explicit reloading is rarely re...
Read more

libgit2 v0.21.0-rc2

17 Jun 10:00
@vmg vmg
Compare
Choose a tag to compare
libgit2 v0.21.0-rc2 Pre-release
Pre-release

RC2 for this thing, because we had to get in a few last-minute fixes. I'll tag the final release tomorrow, hopefully.

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 improvements when doing repeated status checks.
    • New API: git_status_list_get_perfdata gets low-level performance data for a git_status_list (in include/git2/sys/diff.h)
  • Submodules
    • git_submodule objects are now reference counted and must be used with git_submodule_free when done
      ...
Read more