4 This is release v1.0 "Luftschloss", which is the first stabe release of
5 libgit2. The API will stay compatible across all releases of the same major
6 version. This release includes bugfixes only and supersedes v0.99, which will
7 stop being maintained. Both v0.27 and v0.28 stay supported in accordance with
10 ### Changes or improvements
12 - CMake was converted to make use of the GNUInstallDirs module for both our
13 pkgconfig and install targets in favor of our custom build options
14 `BIN_INSTALL_DIR`, `LIB_INSTALL_DIR` and `INCLUDE_INSTALL_DIR`. Instead, you
15 can now use CMakes standard variables `CMAKE_INSTALL_BINDIR`,
16 `CMAKE_INSTALL_LIBDIR` and `CMAKE_INSTALL_INCLUDEDIR`.
18 - Some CMake build options accepted either a specific value or a boolean value
19 to disable the option altogether or use automatic detection. We only accepted
20 "ON" or "OFF", but none of the other values CMake recognizes as boolean. This
21 was aligned with CMake's understanding of booleans.
23 - The installed pkgconfig file contained incorrect values for both `libdir` and
24 `includedir` variables.
26 - If using pcre2 for regular expressions, then we incorrectly added "pcre2"
27 instead of "pcre2-8" to our pkgconfig dependencies, which was corrected.
29 - Fixed building the bundled ntlmclient dependency on FreeBSD, OpenBSD and
32 - When writing symlinks on Windows, we incorrectly handled relative symlink
33 targets, which was corrected.
35 - When using the HTTP protocol via macOS' SecureTransport implementation, reads
36 could stall at the end of the session and only continue after a timeout of 60
39 - The filesystem-based reference callback didn't corectly initialize the backend
42 - A segmentation fault was fixed when calling `git_blame_buffer()` for files
43 that were modified and added to the index.
45 - A backwards-incompatible change was introduced when we moved some structures
46 from "git2/credentials.h" into "git2/sys/credentials.h". This was fixed in the
47 case where you do not use hard deprecation.
49 - Improved error handling in various places.
55 This is v0.99 "Torschlusspanik". This will be the last minor release
56 before libgit2 v1.0. We expect to only respond to bugs in this release,
57 to stabilize it for next major release.
59 It contains significant refactorings, but is expected to be API-compatible
62 ### Changes or improvements
64 * When fetching from an anonymous remote using a URL with authentication
65 information provided in the URL (eg `https://foo:bar@example.com/repo`),
66 we would erroneously include the literal URL in the FETCH_HEAD file.
67 We now remove that to match git's behavior.
69 * Some credential structures, enums and values have been renamed:
70 `git_cred` is now `git_credential`. `git_credtype_t` is now
71 `git_credential_t`. Functions and types beginning with
72 `git_cred_` now begin with `git_credential`, and constants beginning
73 with `GIT_CREDTYPE` now begin with `GIT_CREDENTIAL`. The former names
76 * Several function signatures have been changed to return an `int` to
77 indicate error conditions. We encourage you to check them for errors
80 * `git_attr_cache_flush`
82 * `git_index_name_clear`
83 * `git_index_reuc_clear`
84 * `git_libgit2_version`
92 * `git_remote_disconnect`
93 * `git_repository__cleanup`
94 * `git_repository_set_config`
95 * `git_repository_set_index`
96 * `git_repository_set_odb`
97 * `git_repository_set_refdb`
99 * `git_revwalk_simplify_first_parent`
100 * `git_revwalk_sorting`
101 * `git_treebuilder_clear`
102 * `git_treebuilder_filter`
104 * The NTLM and Negotiate authentication mechanisms are now supported when
105 talking to git implementations hosted on Apache or nginx servers.
107 * The `HEAD` symbolic reference can no longer be deleted.
109 * `git_merge_driver_source_repo` no longer returns a `const git_repository *`,
110 it now returns a non-`const` `git_repository *`.
112 * Relative symbolic links are now supported on Windows when `core.symlinks`
115 * Servers that provide query parameters with a redirect are now supported.
117 * `git_submodule_sync` will now resolve relative URLs.
119 * When creating git endpoint URLs, double-slashes are no longer used when
120 the given git URL has a trailing slash.
122 * On Windows, a `DllMain` function is no longer included and thread-local
123 storage has moved to fiber-local storage in order to prevent race
124 conditions during shutdown.
126 * The tracing mechanism (`GIT_TRACE`) is now enabled by default and does
127 not need to be explicitly enabled in CMake.
129 * The size of Git objects is now represented by `git_object_size_t`
132 * Binary patches without data can now be parsed.
134 * A configuration snapshot can now be created from another configuration
135 snapshot, not just a "true" configuration object.
137 * The `git_commit_with_signature` API will now ensure that referenced
138 objects exist in the object database.
140 * Stash messages containing newlines will now be replaced with spaces;
141 they will no longer be (erroneously) written to the repository.
143 * `git_commit_create_with_signature` now verifies the commit information
144 to ensure that it points to a valid tree and valid parents.
146 * `git_apply` has an option `GIT_APPLY_CHECK` that will only do a dry-run.
147 The index and working directory will remain unmodified, and application
148 will report if it would have worked.
150 * Patches produced by Mercurial (those that lack some git extended headers)
151 can now be parsed and applied.
153 * Reference locks are obeyed correctly on POSIX platforms, instead of
156 * Patches with empty new files can now be read and applied.
158 * `git_apply_to_tree` can now correctly apply patches that add new files.
160 * The program data configuration on Windows (`C:\ProgramData\Git\config`)
161 must be owned by an administrator, a system account or the current user
164 * `git_blob_filtered_content` is now deprecated in favor of `git_blob_filter`.
166 * Configuration files can now be included conditionally using the
167 `onbranch` conditional.
169 * Checkout can now properly create and remove symbolic links to directories
172 * Stash no longer recomputes trees when committing a worktree, for
173 improved performance.
175 * Repository templates can now include a `HEAD` file to default the
176 initial default branch.
178 * Some configuration structures, enums and values have been renamed:
179 `git_cvar_map` is now `git_configmap`, `git_cvar_t` is now
180 `git_configmap_t`, `GIT_CVAR_FALSE` is now `GIT_CONFIGMAP_FALSE`,
181 `GIT_CVAR_TRUE` is now `GIT_CONFIGMAP_TRUE`, `GIT_CVAR_INT32` is now
182 `GIT_CONFIGMAP_INT32`, and `GIT_CVAR_STRING` is now `GIT_CONFIGMAP_STRING`.
183 The former names are deprecated.
185 * Repositories can now be created at the root of a Windows drive.
187 * Configuration lookups are now more efficiently cached.
189 * `git_commit_create_with_signature` now supports a `NULL` signature,
190 which will create a commit without adding a signature.
192 * When a repository lacks an `info` "common directory", we will no
193 longer erroneously return `GIT_ENOTFOUND` for all attribute lookups.
195 * Several attribute macros have been renamed: `GIT_ATTR_TRUE` is now
196 `GIT_ATTR_IS_TRUE`, `GIT_ATTR_FALSE` is now `GIT_ATTR_IS_FALSE`,
197 `GIT_ATTR_UNSPECIFIED` is now `GIT_ATTR_IS_UNSPECIFIED`. The
198 attribute enum `git_attr_t` is now `git_attr_value_t` and its
199 values have been renamed: `GIT_ATTR_UNSPECIFIED_T` is now
200 `GIT_ATTR_VALUE_UNSPECIFIED`, `GIT_ATTR_TRUE_T` is now
201 `GIT_ATTR_VALUE_TRUE`, `GIT_ATTR_FALSE_T` is now `GIT_ATTR_VALUE_FALSE`,
202 and `GIT_ATTR_VALUE_T` is now `GIT_ATTR_VALUE_STRING`. The
203 former names are deprecated.
205 * `git_object__size` is now `git_object_size`. The former name is
208 * `git_tag_create_frombuffer` is now `git_tag_create_from_buffer`. The
209 former name is deprecated.
211 * Several blob creation functions have been renamed:
212 `git_blob_create_frombuffer` is now named `git_blob_create_from_buffer`,
213 `git_blob_create_fromdisk` is now named `git_blob_create_from_disk`,
214 `git_blob_create_fromworkdir` is now named `git_blob_create_from_workdir`,
215 `git_blob_create_fromstream` is now named `git_blob_create_from_stream`,
216 and `git_blob_create_fromstream_commit` is now named
217 `git_blob_create_from_stream_commit`. The former names are deprecated.
219 * The function `git_oid_iszero` is now named `git_oid_is_zero`. The
220 former name is deprecated.
222 * Pattern matching is now done using `wildmatch` instead of `fnmatch`
223 for compatibility with git.
225 * The option initialization functions suffixed by `init_options` are now
226 suffixed with `options_init`. (For example, `git_checkout_init_options`
227 is now `git_checkout_options_init`.) The former names are deprecated.
229 * NTLM2 authentication is now supported on non-Windows platforms.
231 * The `git_cred_sign_callback` callback is now named `git_cred_sign_cb`.
232 The `git_cred_ssh_interactive_callback` callback is now named
233 `git_cred_ssh_interactive_cb`.
237 * honor escaped trailing whitespace.
238 * do not incorrectly negate sibling paths of a negated pattern.
239 * honor rules that stop ignoring files after a wildcard
241 * Attribute files now:
243 * honor leading and trailing whitespace.
244 * treat paths beginning with `\` as absolute only on Windows.
245 * properly handle escaped characters.
246 * stop reading macros defined in subdirectories
248 * The C locale is now correctly used when parsing regular expressions.
250 * The system PCRE2 or PCRE regular expression libraries are now used
251 when `regcomp_l` is not available on the system. If none of these
252 are available on the system, an included version of PCRE is used.
254 * Wildcards in reference specifications are now supported beyond simply
255 a bare wildcard (`*`) for compatibility with git.
257 * When `git_ignore_path_is_ignored` is provided a path with a trailing
258 slash (eg, `dir/`), it will now treat it as a directory for the
259 purposes of ignore matching.
261 * Patches that add or remove a file with a space in the path can now
264 * The `git_remote_completion_type` type is now `git_remote_completion_t`.
265 The former name is deprecated.
267 * The `git_odb_backend_malloc` is now `git_odb_backend_data_alloc`. The
268 former name is deprecated.
270 * The `git_transfer_progress_cb` callback is now `git_indexer_progress_cb`
271 and the `git_transfer_progress` structure is now `git_indexer_progress`.
272 The former names are deprecated.
274 * The example projects are now contained in a single `lg2` executable
277 * libgit2 now correctly handles more URLs, such as
278 `http://example.com:/repo.git` (colon but no port),
279 `http://example.com` (no path),
280 and `http://example.com:8080/` (path is /, nonstandard port).
282 * A carefully constructed commit object with a very large number
283 of parents may lead to potential out-of-bounds writes or
284 potential denial of service.
286 * The ProgramData configuration file is always read for compatibility
287 with Git for Windows and Portable Git installations. The ProgramData
288 location is not necessarily writable only by administrators, so we
289 now ensure that the configuration file is owned by the administrator
294 * The SSH host key now supports SHA-256 when `GIT_CERT_SSH_SHA256` is set.
296 * The diff format option `GIT_DIFF_FORMAT_PATCH_ID` can now be used to
297 emit an output like `git patch-id`.
299 * The `git_apply_options_init` function will initialize a
300 `git_apply_options` structure.
302 * The remote callbacks structure adds a `git_url_resolve_cb` callback
303 that is invoked when connecting to a server, so that applications
304 may edit or replace the URL before connection.
306 * The information about the original `HEAD` in a rebase operation is
307 available with `git_rebase_orig_head_name`. Its ID is available with
308 `git_rebase_orig_head_id`. The `onto` reference name is available with
309 `git_rebase_onto_name` and its ID is available with `git_rebase_onto_id`.
311 * ODB backends can now free backend data when an error occurs during its
312 backend data creation using `git_odb_backend_data_free`.
314 * Options may be specified to `git_repository_foreach_head` to control
315 its behavior: `GIT_REPOSITORY_FOREACH_HEAD_SKIP_REPO` will not skip
316 the main repository's HEAD reference, while
317 `GIT_REPOSITORY_FOREACH_HEAD_SKIP_WORKTREES` will now skip the
318 worktree HEAD references.
320 * The `GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS` option can be specified to
321 `git_libgit2_opts()` to avoid looking for `.keep` files that correspond
322 to packfiles. This setting can improve performance when packfiles are
323 stored on high-latency filesystems like network filesystems.
325 * Blobs can now be filtered with `git_blob_filter`, which allows for
326 options to be set with `git_blob_filter_options`, including
327 `GIT_FILTER_NO_SYSTEM_ATTRIBUTES` to disable filtering with system-level
328 attributes in `/etc/gitattributes` and `GIT_ATTR_CHECK_INCLUDE_HEAD` to
329 enable filtering with `.gitattributes` files in the HEAD revision.
333 * The unused `git_headlist_cb` function declaration was removed.
335 * The unused `git_time_monotonic` API is removed.
337 * The erroneously exported `inttypes.h` header was removed.
341 - CVE-2019-1348: the fast-import stream command "feature
342 export-marks=path" allows writing to arbitrary file paths. As
343 libgit2 does not offer any interface for fast-import, it is not
344 susceptible to this vulnerability.
346 - CVE-2019-1349: by using NTFS 8.3 short names, backslashes or
347 alternate filesystreams, it is possible to cause submodules to
348 be written into pre-existing directories during a recursive
349 clone using git. As libgit2 rejects cloning into non-empty
350 directories by default, it is not susceptible to this
353 - CVE-2019-1350: recursive clones may lead to arbitrary remote
354 code executing due to improper quoting of command line
355 arguments. As libgit2 uses libssh2, which does not require us
356 to perform command line parsing, it is not susceptible to this
359 - CVE-2019-1351: Windows provides the ability to substitute
360 drive letters with arbitrary letters, including multi-byte
361 Unicode letters. To fix any potential issues arising from
362 interpreting such paths as relative paths, we have extended
363 detection of DOS drive prefixes to accomodate for such cases.
365 - CVE-2019-1352: by using NTFS-style alternative file streams for
366 the ".git" directory, it is possible to overwrite parts of the
367 repository. While this has been fixed in the past for Windows,
368 the same vulnerability may also exist on other systems that
369 write to NTFS filesystems. We now reject any paths starting
370 with ".git:" on all systems.
372 - CVE-2019-1353: by using NTFS-style 8.3 short names, it was
373 possible to write to the ".git" directory and thus overwrite
374 parts of the repository, leading to possible remote code
375 execution. While this problem was already fixed in the past for
376 Windows, other systems accessing NTFS filesystems are
377 vulnerable to this issue too. We now enable NTFS protecions by
378 default on all systems to fix this attack vector.
380 - CVE-2019-1354: on Windows, backslashes are not a valid part of
381 a filename but are instead interpreted as directory separators.
382 As other platforms allowed to use such paths, it was possible
383 to write such invalid entries into a Git repository and was
384 thus an attack vector to write into the ".git" dierctory. We
385 now reject any entries starting with ".git\" on all systems.
387 - CVE-2019-1387: it is possible to let a submodule's git
388 directory point into a sibling's submodule directory, which may
389 result in overwriting parts of the Git repository and thus lead
390 to arbitrary command execution. As libgit2 doesn't provide any
391 way to do submodule clones natively, it is not susceptible to
392 this vulnerability. Users of libgit2 that have implemented
393 recursive submodule clones manually are encouraged to review
394 their implementation for this vulnerability.
396 ### Breaking API changes
398 * The "private" implementation details of the `git_cred` structure have been
399 moved to a dedicated `git2/sys/cred.h` header, to clarify that the underlying
400 structures are only provided for custom transport implementers.
401 The breaking change is that the `username` member of the underlying struct
402 is now hidden, and a new `git_cred_get_username` function has been provided.
404 ### Breaking CMake configuration changes
406 * The CMake option to use a system http-parser library, instead of the
407 bundled dependency, has changed. This is due to a deficiency in
408 http-parser that we have fixed in our implementation. The bundled
409 library is now the default, but if you wish to force the use of the
410 system http-parser implementation despite incompatibilities, you can
411 specify `-DUSE_HTTP_PARSER=system` to CMake.
413 * The interactions between `USE_HTTPS` and `SHA1_BACKEND` have been
414 streamlined. The detection was moved to a new `USE_SHA1`, modeled after
415 `USE_HTTPS`, which takes the values "CollisionDetection/Backend/Generic", to
416 better match how the "hashing backend" is selected, the default (ON) being
417 "CollisionDetection". If you were using `SHA1_BACKEND` previously, you'll
418 need to check the value you've used, or switch to the autodetection.
422 The following individuals provided changes that were included in this
433 * Carlos MartÃn Nieto
441 * Dhruva Krishnamurthy
452 * Janardhan Pulivarthi
454 * Johannes Schindelin
456 * Josh Bleecher Snyder
480 ### Changes or improvements
482 * The library is now always built with cdecl calling conventions on
483 Windows; the ability to build a stdcall library has been removed.
485 * Reference log creation now honors `core.logallrefupdates=always`.
487 * Fix some issues with the error-reporting in the OpenSSL backend.
489 * HTTP proxy support is now builtin; libcurl is no longer used to support
490 proxies and is removed as a dependency.
492 * Certificate and credential callbacks can now return `GIT_PASSTHROUGH`
493 to decline to act; libgit2 will behave as if there was no callback set
496 * The line-ending filtering logic - when checking out files - has been
497 updated to match newer git (>= git 2.9) for proper interoperability.
499 * Symbolic links are now supported on Windows when `core.symlinks` is set
502 * Submodules with names which attempt to perform path traversal now have their
503 configuration ignored. Such names were blindly appended to the
504 `$GIT_DIR/modules` and a malicious name could lead to an attacker writing to
505 an arbitrary location. This matches git's handling of CVE-2018-11235.
507 * Object validation is now performed during tree creation in the
508 `git_index_write_tree_to` API.
510 * Configuration variable may now be specified on the same line as a section
511 header; previously this was erroneously a parser error.
513 * When an HTTP server supports both NTLM and Negotiate authentication
514 mechanisms, we would previously fail to authenticate with any mechanism.
516 * The `GIT_OPT_SET_PACK_MAX_OBJECTS` option can now set the maximum
517 number of objects allowed in a packfile being downloaded; this can help
518 limit the maximum memory used when fetching from an untrusted remote.
520 * Line numbers in diffs loaded from patch files were not being populated;
521 they are now included in the results.
523 * The repository's index is reloaded from disk at the beginning of
524 `git_merge` operations to ensure that it is up-to-date.
526 * Mailmap handling APIs have been introduced, and the new commit APIs
527 `git_commit_committer_with_mailmap` and `git_commit_author_with_mailmap`
528 will use the mailmap to resolve the committer and author information.
529 In addition, blame will use the mailmap given when the
530 `GIT_BLAME_USE_MAILMAP` option.
532 * Ignore handling for files in ignored folders would be ignored.
534 * Worktrees can now be backed by bare repositories.
536 * Trailing spaces are supported in `.gitignore` files, these spaces were
537 previously (and erroneously) treated as part of the pattern.
539 * The library can now be built with mbedTLS support for HTTPS.
541 * The diff status character 'T' will now be presented by the
542 `git_diff_status_char` API for diff entries that change type.
544 * Revision walks previously would sometimes include commits that should
545 have been ignored; this is corrected.
547 * Revision walks are now more efficient when the output is unsorted;
548 we now avoid walking all the way to the beginning of history unnecessarily.
550 * Error-handling around index extension loading has been fixed. We were
551 previously always misreporting a truncated index (#4858).
555 * The index may now be iterated atomically using `git_index_iterator`.
557 * Remote objects can now be created with extended options using the
558 `git_remote_create_with_opts` API.
560 * Diff objects can now be applied as changes to the working directory,
561 index or both, emulating the `git apply` command. Additionally,
562 `git_apply_to_tree` can apply those changes to a tree object as a
563 fully in-memory operation.
565 * You can now swap out memory allocators via the
566 `GIT_OPT_SET_ALLOCATOR` option with `git_libgit2_opts()`.
568 * You can now ensure that functions do not discard unwritten changes to the
569 index via the `GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY` option to
570 `git_libgit2_opts()`. This will cause functions that implicitly re-read
571 the index (eg, `git_checkout`) to fail if you have staged changes to the
572 index but you have not written the index to disk. (Unless the checkout
573 has the FORCE flag specified.)
575 At present, this defaults to off, but we intend to enable this more
576 broadly in the future, as a warning or error. We encourage you to
577 examine your code to ensure that you are not relying on the current
578 behavior that implicitly removes staged changes.
580 * Reference specifications can be parsed from an arbitrary string with
581 the `git_refspec_parse` API.
583 * You can now get the name and path of worktrees using the
584 `git_worktree_name` and `git_worktree_path` APIs, respectively.
586 * The `ref` field has been added to `git_worktree_add_options` to enable
587 the creation of a worktree from a pre-existing branch.
589 * It's now possible to analyze merge relationships between any two
590 references, not just against `HEAD`, using `git_merge_analysis_for_ref`.
594 * The `git_buf_free` API is deprecated; it has been renamed to
595 `git_buf_dispose` for consistency. The `git_buf_free` API will be
596 retained for backward compatibility for the foreseeable future.
598 * The `git_otype` enumeration and its members are deprecated and have
599 been renamed for consistency. The `GIT_OBJ_` enumeration values are
600 now prefixed with `GIT_OBJECT_`. The old enumerations and macros
601 will be retained for backward compatibility for the foreseeable future.
603 * Several index-related APIs have been renamed for consistency. The
604 `GIT_IDXENTRY_` enumeration values and macros have been renamed to
605 be prefixed with `GIT_INDEX_ENTRY_`. The `GIT_INDEXCAP` enumeration
606 values are now prefixed with `GIT_INDEX_CAPABILITY_`. The old
607 enumerations and macros will be retained for backward compatibility
608 for the foreseeable future.
610 * The error functions and enumeration values have been renamed for
611 consistency. The `giterr_` functions and values prefix have been
612 renamed to be prefixed with `git_error_`; similarly, the `GITERR_`
613 constants have been renamed to be prefixed with `GIT_ERROR_`.
614 The old enumerations and macros will be retained for backward
615 compatibility for the foreseeable future.
617 ### Breaking API changes
619 * The default checkout strategy changed from `DRY_RUN` to `SAFE` (#4531).
621 * Adding a symlink as .gitmodules into the index from the workdir or checking
622 out such files is not allowed as this can make a Git implementation write
623 outside of the repository and bypass the fsck checks for CVE-2018-11235.
628 ### Changes or improvements
630 * Improved `p_unlink` in `posix_w32.c` to try and make a file writable
631 before sleeping in the retry loop to prevent unnecessary calls to sleep.
633 * The CMake build infrastructure has been improved to speed up building time.
635 * A new CMake option "-DUSE_HTTPS=<backend>" makes it possible to explicitly
636 choose an HTTP backend.
638 * A new CMake option "-DSHA1_BACKEND=<backend>" makes it possible to explicitly
639 choose an SHA1 backend. The collision-detecting backend is now the default.
641 * A new CMake option "-DUSE_BUNDLED_ZLIB" makes it possible to explicitly use
642 the bundled zlib library.
644 * A new CMake option "-DENABLE_REPRODUCIBLE_BUILDS" makes it possible to
645 generate a reproducible static archive. This requires support from your
648 * The minimum required CMake version has been bumped to 2.8.11.
650 * Writing to a configuration file now preserves the case of the key given by the
651 caller for the case-insensitive portions of the key (existing sections are
652 used even if they don't match).
654 * We now support conditional includes in configuration files.
656 * Fix for handling re-reading of configuration files with includes.
658 * Fix for reading patches which contain exact renames only.
660 * Fix for reading patches with whitespace in the compared files' paths.
662 * We will now fill `FETCH_HEAD` from all passed refspecs instead of overwriting
665 * There is a new diff option, `GIT_DIFF_INDENT_HEURISTIC` which activates a
666 heuristic which takes into account whitespace and indentation in order to
667 produce better diffs when dealing with ambiguous diff hunks.
669 * Fix for pattern-based ignore rules where files ignored by a rule cannot be
670 un-ignored by another rule.
672 * Sockets opened by libgit2 are now being closed on exec(3) if the platform
675 * Fix for peeling annotated tags from packed-refs files.
677 * Fix reading huge loose objects from the object database.
679 * Fix files not being treated as modified when only the file mode has changed.
681 * We now explicitly reject adding submodules to the index via
682 `git_index_add_frombuffer`.
684 * Fix handling of `GIT_DIFF_FIND_RENAMES_FROM_REWRITES` raising `SIGABRT` when
685 one file has been deleted and another file has been rewritten.
687 * Fix for WinHTTP not properly handling NTLM and Negotiate challenges.
689 * When using SSH-based transports, we now repeatedly ask for the passphrase to
690 decrypt the private key in case a wrong passphrase is being provided.
692 * When generating conflict markers, they will now use the same line endings as
693 the rest of the file.
697 * The `git_merge_file_options` structure now contains a new setting,
698 `marker_size`. This allows users to set the size of markers that
699 delineate the sides of merged files in the output conflict file.
700 By default this is 7 (`GIT_MERGE_CONFLICT_MARKER_SIZE`), which
701 produces output markers like `<<<<<<<` and `>>>>>>>`.
703 * `git_remote_create_detached()` creates a remote that is not associated
704 to any repository (and does not apply configuration like 'insteadof' rules).
705 This is mostly useful for e.g. emulating `git ls-remote` behavior.
707 * `git_diff_patchid()` lets you generate patch IDs for diffs.
709 * `git_status_options` now has an additional field `baseline` to allow creating
710 status lists against different trees.
712 * New family of functions to allow creating notes for a specific notes commit
713 instead of for a notes reference.
715 * New family of functions to allow parsing message trailers. This API is still
716 experimental and may change in future releases.
720 ### Breaking API changes
722 * Signatures now distinguish between +0000 and -0000 UTC offsets.
724 * The certificate check callback in the WinHTTP transport will now receive the
725 `message_cb_payload` instead of the `cred_acquire_payload`.
727 * We are now reading symlinked directories under .git/refs.
729 * We now refuse creating branches named "HEAD".
731 * We now refuse reading and writing all-zero object IDs into the
734 * We now read the effective user's configuration file instead of the real user's
735 configuration in case libgit2 runs as part of a setuid binary.
737 * The `git_odb_open_rstream` function and its `readstream` callback in the
738 `git_odb_backend` interface have changed their signatures to allow providing
739 the object's size and type to the caller.
744 ### Changes or improvements
746 * Support for opening, creating and modifying worktrees.
748 * We can now detect SHA1 collisions resulting from the SHAttered attack. These
749 checks can be enabled at build time via `-DUSE_SHA1DC`.
751 * Fix for missing implementation of `git_merge_driver_source` getters.
753 * Fix for installed pkg-config file being broken when the prefix contains
756 * We now detect when the hashsum of on-disk objects does not match their
759 * We now support open-ended ranges (e.g. "master..", "...master") in our
760 revision range parsing code.
762 * We now correctly compute ignores with leading "/" in subdirectories.
764 * We now optionally call `fsync` on loose objects, packfiles and their indexes,
765 loose references and packed reference files.
767 * We can now build against OpenSSL v1.1 and against LibreSSL.
769 * `GIT_MERGE_OPTIONS_INIT` now includes a setting to perform rename detection.
770 This aligns this structure with the default by `git_merge` and
771 `git_merge_trees` when `NULL` was provided for the options.
773 * Improvements for reading index v4 files.
775 * Perform additional retries for filesystem operations on Windows when files
776 are temporarily locked by other processes.
780 * New family of functions to handle worktrees:
782 * `git_worktree_list()` lets you look up worktrees for a repository.
783 * `git_worktree_lookup()` lets you get a specific worktree.
784 * `git_worktree_open_from_repository()` lets you get the associated worktree
787 * `git_worktree_add` lets you create new worktrees.
788 * `git_worktree_prune` lets you remove worktrees from disk.
789 * `git_worktree_lock()` and `git_worktree_unlock()` let you lock
790 respectively unlock a worktree.
791 * `git_repository_open_from_worktree()` lets you open a repository via
792 * `git_repository_head_for_worktree()` lets you get the current `HEAD` for a
794 * `git_repository_head_detached_for_worktree()` lets you check whether a
795 linked worktree is in detached HEAD mode.
797 * `git_repository_item_path()` lets you retrieve paths for various repository
800 * `git_repository_commondir()` lets you retrieve the common directory of a
803 * `git_branch_is_checked_out()` allows you to check whether a branch is checked
804 out in a repository or any of its worktrees.
806 * `git_repository_submodule_cache_all()` and
807 `git_repository_submodule_cache_clear()` functions allow you to prime or clear
808 the submodule cache of a repository.
810 * You can disable strict hash verifications via the
811 `GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION` option with `git_libgit2_opts()`.
813 * You can enable us calling `fsync` for various files inside the ".git"
814 directory by setting the `GIT_OPT_ENABLE_FSYNC_GITDIR` option with
815 `git_libgit2_opts()`.
817 * You can now enable "offset deltas" when creating packfiles and negotiating
818 packfiles with a remote server by setting `GIT_OPT_ENABLE_OFS_DELTA` option
819 with `GIT_libgit2_opts()`.
821 * You can now set the default share mode on Windows for opening files using
822 `GIT_OPT_SET_WINDOWS_SHAREMODE` option with `git_libgit2_opts()`.
823 You can query the current share mode with `GIT_OPT_GET_WINDOWS_SHAREMODE`.
825 * `git_transport_smart_proxy_options()' enables you to get the proxy options for
828 * The `GIT_FILTER_INIT` macro and the `git_filter_init` function are provided
829 to initialize a `git_filter` structure.
831 ### Breaking API changes
833 * `clone_checkout_strategy` has been removed from
834 `git_submodule_update_option`. The checkout strategy used to clone will
835 be the same strategy specified in `checkout_opts`.
840 ### Changes or improvements
842 * Fix repository discovery with `git_repository_discover` and
843 `git_repository_open_ext` to match git's handling of a ceiling
844 directory at the current directory. git only checks ceiling
845 directories when its search ascends to a parent directory. A ceiling
846 directory matching the starting directory will not prevent git from
847 finding a repository in the starting directory or a parent directory.
849 * Do not fail when deleting remotes in the presence of broken
850 global configs which contain branches.
852 * Support for reading and writing git index v4 files
854 * Improve the performance of the revwalk and bring us closer to git's code.
856 * The reference db has improved support for concurrency and returns `GIT_ELOCKED`
857 when an operation could not be performed due to locking.
859 * Nanosecond resolution is now activated by default, following git's change to
862 * We now restrict the set of ciphers we let OpenSSL use by default.
864 * Users can now register their own merge drivers for use with `.gitattributes`.
865 The library also gained built-in support for the union merge driver.
867 * The default for creating references is now to validate that the object does
870 * Add `git_proxy_options` which is used by the different networking
871 implementations to let the caller specify the proxy settings instead of
872 relying on the environment variables.
876 * You can now get the user-agent used by libgit2 using the
877 `GIT_OPT_GET_USER_AGENT` option with `git_libgit2_opts()`.
878 It is the counterpart to `GIT_OPT_SET_USER_AGENT`.
880 * The `GIT_OPT_SET_SSL_CIPHERS` option for `git_libgit2_opts()` lets you specify
881 a custom list of ciphers to use for OpenSSL.
883 * `git_commit_create_buffer()` creates a commit and writes it into a
884 user-provided buffer instead of writing it into the object db. Combine it with
885 `git_commit_create_with_signature()` in order to create a commit with a
886 cryptographic signature.
888 * `git_blob_create_fromstream()` and
889 `git_blob_create_fromstream_commit()` allow you to create a blob by
890 writing into a stream. Useful when you do not know the final size or
891 want to copy the contents from another stream.
893 * New flags for `git_repository_open_ext`:
895 * `GIT_REPOSITORY_OPEN_NO_DOTGIT` - Do not check for a repository by
896 appending `/.git` to the `start_path`; only open the repository if
897 `start_path` itself points to the git directory.
898 * `GIT_REPOSITORY_OPEN_FROM_ENV` - Find and open a git repository,
899 respecting the environment variables used by the git command-line
900 tools. If set, `git_repository_open_ext` will ignore the other
901 flags and the `ceiling_dirs` argument, and will allow a NULL
902 `path` to use `GIT_DIR` or search from the current directory. The
903 search for a repository will respect `$GIT_CEILING_DIRECTORIES`
904 and `$GIT_DISCOVERY_ACROSS_FILESYSTEM`. The opened repository
905 will respect `$GIT_INDEX_FILE`, `$GIT_NAMESPACE`,
906 `$GIT_OBJECT_DIRECTORY`, and `$GIT_ALTERNATE_OBJECT_DIRECTORIES`.
907 In the future, this flag will also cause `git_repository_open_ext`
908 to respect `$GIT_WORK_TREE` and `$GIT_COMMON_DIR`; currently,
909 `git_repository_open_ext` with this flag will error out if either
910 `$GIT_WORK_TREE` or `$GIT_COMMON_DIR` is set.
912 * `git_diff_from_buffer()` can create a `git_diff` object from the contents
913 of a git-style patch file.
915 * `git_index_version()` and `git_index_set_version()` to get and set
918 * `git_odb_expand_ids()` lets you check for the existence of multiple
921 * The new `git_blob_dup()`, `git_commit_dup()`, `git_tag_dup()` and
922 `git_tree_dup()` functions provide type-specific wrappers for
923 `git_object_dup()` to reduce noise and increase type safety for callers.
925 * `git_reference_dup()` lets you duplicate a reference to aid in ownership
926 management and cleanup.
928 * `git_signature_from_buffer()` lets you create a signature from a string in the
929 format that appear in objects.
931 * `git_tree_create_updated()` lets you create a tree based on another one
932 together with a list of updates. For the covered update cases, it's more
933 efficient than the `git_index` route.
935 * `git_apply_patch()` applies hunks from a `git_patch` to a buffer.
937 * `git_diff_to_buf()` lets you print an entire diff directory to a buffer,
938 similar to how `git_patch_to_buf()` works.
940 * `git_proxy_init_options()` is added to initialize a `git_proxy_options`
941 structure at run-time.
943 * `git_merge_driver_register()`, `git_merge_driver_unregister()` let you
944 register and unregister a custom merge driver to be used when `.gitattributes`
947 * `git_merge_driver_lookup()` can be used to look up a merge driver by name.
949 * `git_merge_driver_source_repo()`, `git_merge_driver_source_ancestor()`,
950 `git_merge_driver_source_ours()`, `git_merge_driver_source_theirs()`,
951 `git_merge_driver_source_file_options()` added as accessors to
952 `git_merge_driver_source`.
956 * `git_blob_create_fromchunks()` has been removed in favour of
957 `git_blob_create_fromstream()`.
959 ### Breaking API changes
961 * `git_packbuilder_object_count` and `git_packbuilder_written` now
962 return a `size_t` instead of a `uint32_t` for more thorough
963 compatibility with the rest of the library.
965 * `git_packbuiler_progress` now provides explicitly sized `uint32_t`
966 values instead of `unsigned int`.
968 * `git_diff_file` now includes an `id_abbrev` field that reflects the
969 number of nibbles set in the `id` field.
971 * `git_odb_backend` now has a `freshen` function pointer. This optional
972 function pointer is similar to the `exists` function, but it will update
973 a last-used marker. For filesystem-based object databases, this updates
974 the timestamp of the file containing the object, to indicate "freshness".
975 If this is `NULL`, then it will not be called and the `exists` function
976 will be used instead.
978 * `git_remote_connect()` now accepts `git_proxy_options` argument, and
979 `git_fetch_options` and `git_push_options` each have a `proxy_opts` field.
981 * `git_merge_options` now provides a `default_driver` that can be used
982 to provide the name of a merge driver to be used to handle files changed
988 ### Changes or improvements
990 * Custom merge drivers can now be registered, which allows callers to
991 configure callbacks to honor `merge=driver` configuration in
994 * Custom filters can now be registered with wildcard attributes, for
995 example `filter=*`. Consumers should examine the attributes parameter
996 of the `check` function for details.
998 * Symlinks are now followed when locking a file, which can be
999 necessary when multiple worktrees share a base repository.
1001 * You can now set your own user-agent to be sent for HTTP requests by
1002 using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`.
1004 * You can set custom HTTP header fields to be sent along with requests
1005 by passing them in the fetch and push options.
1007 * Tree objects are now assumed to be sorted. If a tree is not
1008 correctly formed, it will give bad results. This is the git approach
1009 and cuts a significant amount of time when reading the trees.
1011 * Filter registration is now protected against concurrent
1014 * Filenames which are not valid on Windows in an index no longer cause
1015 to fail to parse it on that OS.
1017 * Rebases can now be performed purely in-memory, without touching the
1018 repository's workdir.
1020 * When adding objects to the index, or when creating new tree or commit
1021 objects, the inputs are validated to ensure that the dependent objects
1022 exist and are of the correct type. This object validation can be
1023 disabled with the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION option.
1025 * The WinHTTP transport's handling of bad credentials now behaves like
1026 the others, asking for credentials again.
1030 * `git_config_lock()` has been added, which allow for
1031 transactional/atomic complex updates to the configuration, removing
1032 the opportunity for concurrent operations and not committing any
1033 changes until the unlock.
1035 * `git_diff_options` added a new callback `progress_cb` to report on the
1036 progress of the diff as files are being compared. The documentation of
1037 the existing callback `notify_cb` was updated to reflect that it only
1038 gets called when new deltas are added to the diff.
1040 * `git_fetch_options` and `git_push_options` have gained a `custom_headers`
1041 field to set the extra HTTP header fields to send.
1043 * `git_stream_register_tls()` lets you register a callback to be used
1044 as the constructor for a TLS stream instead of the libgit2 built-in
1047 * `git_commit_header_field()` allows you to look up a specific header
1050 * `git_commit_extract_signature()` extracts the signature from a
1051 commit and gives you both the signature and the signed data so you
1056 * No APIs were removed in this version.
1058 ### Breaking API changes
1060 * The `git_merge_tree_flag_t` is now `git_merge_flag_t`. Subsequently,
1061 its members are no longer prefixed with `GIT_MERGE_TREE_FLAG` but are
1062 now prefixed with `GIT_MERGE_FLAG`, and the `tree_flags` field of the
1063 `git_merge_options` structure is now named `flags`.
1065 * The `git_merge_file_flags_t` enum is now `git_merge_file_flag_t` for
1066 consistency with other enum type names.
1068 * `git_cert` descendent types now have a proper `parent` member
1070 * It is the responsibility of the refdb backend to decide what to do
1071 with the reflog on ref deletion. The file-based backend must delete
1072 it, a database-backed one may wish to archive it.
1074 * `git_config_backend` has gained two entries. `lock` and `unlock`
1075 with which to implement the transactional/atomic semantics for the
1076 configuration backend.
1078 * `git_index_add` and `git_index_conflict_add()` will now use the case
1079 as provided by the caller on case insensitive systems. Previous
1080 versions would keep the case as it existed in the index. This does
1081 not affect the higher-level `git_index_add_bypath` or
1082 `git_index_add_frombuffer` functions.
1084 * The `notify_payload` field of `git_diff_options` was renamed to `payload`
1085 to reflect that it's also the payload for the new progress callback.
1087 * The `git_config_level_t` enum has gained a higher-priority value
1088 `GIT_CONFIG_LEVEL_PROGRAMDATA` which represent a rough Windows equivalent
1089 to the system level configuration.
1091 * `git_rebase_options` now has a `merge_options` field.
1093 * The index no longer performs locking itself. This is not something
1094 users of the library should have been relying on as it's not part of
1095 the concurrency guarantees.
1097 * `git_remote_connect()` now takes a `custom_headers` argument to set
1098 the extra HTTP header fields to send.
1103 ### Changes or improvements
1105 * Patience and minimal diff drivers can now be used for merges.
1107 * Merges can now ignore whitespace changes.
1109 * Updated binary identification in CRLF filtering to avoid false positives in
1112 * Rename and copy detection is enabled for small files.
1114 * Checkout can now handle an initial checkout of a repository, making
1115 `GIT_CHECKOUT_SAFE_CREATE` unnecessary for users of clone.
1117 * The signature parameter in the ref-modifying functions has been
1118 removed. Use `git_repository_set_ident()` and
1119 `git_repository_ident()` to override the signature to be used.
1121 * The local transport now auto-scales the number of threads to use
1122 when creating the packfile instead of sticking to one.
1124 * Reference renaming now uses the right id for the old value.
1126 * The annotated version of branch creation, HEAD detaching and reset
1127 allow for specifying the expression from the user to be put into the
1130 * `git_rebase_commit` now returns `GIT_EUNMERGED` when you attempt to
1131 commit with unstaged changes.
1133 * On Mac OS X, we now use SecureTransport to provide the cryptographic
1134 support for HTTPS connections insead of OpenSSL.
1136 * Checkout can now accept an index for the baseline computations via the
1137 `baseline_index` member.
1139 * The configuration for fetching is no longer stored inside the
1140 `git_remote` struct but has been moved to a `git_fetch_options`. The
1141 remote functions now take these options or the callbacks instead of
1142 setting them beforehand.
1144 * `git_submodule` instances are no longer cached or shared across
1145 lookup. Each submodule represents the configuration at the time of
1148 * The index now uses diffs for `add_all()` and `update_all()` which
1149 gives it a speed boost and closer semantics to git.
1151 * The ssh transport now reports the stderr output from the server as
1152 the error message, which allows you to get the "repository not
1155 * `git_index_conflict_add()` will remove staged entries that exist for
1158 * The flags for a `git_diff_file` will now have the `GIT_DIFF_FLAG_EXISTS`
1159 bit set when a file exists on that side of the diff. This is useful
1160 for understanding whether a side of the diff exists in the presence of
1163 * The constructor for a write-stream into the odb now takes
1164 `git_off_t` instead of `size_t` for the size of the blob, which
1165 allows putting large files into the odb on 32-bit systems.
1167 * The remote's push and pull URLs now honor the url.$URL.insteadOf
1168 configuration. This allows modifying URL prefixes to a custom
1169 value via gitconfig.
1171 * `git_diff_foreach`, `git_diff_blobs`, `git_diff_blob_to_buffer`,
1172 and `git_diff_buffers` now accept a new binary callback of type
1173 `git_diff_binary_cb` that includes the binary diff information.
1175 * The race condition mitigations described in `racy-git.txt` have been
1178 * If libcurl is installed, we will use it to connect to HTTP(S)
1183 * The `git_merge_options` gained a `file_flags` member.
1185 * Parsing and retrieving a configuration value as a path is exposed
1186 via `git_config_parse_path()` and `git_config_get_path()`
1189 * `git_repository_set_ident()` and `git_repository_ident()` serve to
1190 set and query which identity will be used when writing to the
1193 * `git_config_entry_free()` frees a config entry.
1195 * `git_config_get_string_buf()` provides a way to safely retrieve a
1196 string from a non-snapshot configuration.
1198 * `git_annotated_commit_from_revspec()` allows to get an annotated
1199 commit from an extended sha synatx string.
1201 * `git_repository_set_head_detached_from_annotated()`,
1202 `git_branch_create_from_annotated()` and
1203 `git_reset_from_annotated()` allow for the caller to provide an
1204 annotated commit through which they can control what expression is
1205 put into the reflog as the source/target.
1207 * `git_index_add_frombuffer()` can now create a blob from memory
1208 buffer and add it to the index which is attached to a repository.
1210 * The structure `git_fetch_options` has been added to determine the
1211 runtime configuration for fetching, such as callbacks, pruning and
1212 autotag behaviour. It has the runtime initializer
1213 `git_fetch_init_options()`.
1215 * The enum `git_fetch_prune_t` has been added, letting you specify the
1216 pruning behaviour for a fetch.
1218 * A push operation will notify the caller of what updates it indends
1219 to perform on the remote, which provides similar information to
1220 git's pre-push hook.
1222 * `git_stash_apply()` can now apply a stashed state from the stash list,
1223 placing the data into the working directory and index.
1225 * `git_stash_pop()` will apply a stashed state (like `git_stash_apply()`)
1226 but will remove the stashed state after a successful application.
1228 * A new error code `GIT_EEOF` indicates an early EOF from the
1229 server. This typically indicates an error with the URL or
1230 configuration of the server, and tools can use this to show messages
1231 about failing to communicate with the server.
1233 * A new error code `GIT_EINVALID` indicates that an argument to a
1234 function is invalid, or an invalid operation was requested.
1236 * `git_diff_index_to_workdir()` and `git_diff_tree_to_index()` will now
1237 produce deltas of type `GIT_DELTA_CONFLICTED` to indicate that the index
1238 side of the delta is a conflict.
1240 * The `git_status` family of functions will now produce status of type
1241 `GIT_STATUS_CONFLICTED` to indicate that a conflict exists for that file
1244 * `git_index_entry_is_conflict()` is a utility function to determine if
1245 a given index entry has a non-zero stage entry, indicating that it is
1246 one side of a conflict.
1248 * It is now possible to pass a keypair via a buffer instead of a
1249 path. For this, `GIT_CREDTYPE_SSH_MEMORY` and
1250 `git_cred_ssh_key_memory_new()` have been added.
1252 * `git_filter_list_contains` will indicate whether a particular
1253 filter will be run in the given filter list.
1255 * `git_commit_header_field()` has been added, which allows retrieving
1256 the contents of an arbitrary header field.
1258 * `git_submodule_set_branch()` allows to set the configured branch for
1263 * `git_remote_save()` and `git_remote_clear_refspecs()` have been
1264 removed. Remote's configuration is changed via the configuration
1265 directly or through a convenience function which performs changes to
1266 the configuration directly.
1268 * `git_remote_set_callbacks()`, `git_remote_get_callbacks()` and
1269 `git_remote_set_transport()` have been removed and the remote no
1270 longer stores this configuration.
1272 * `git_remote_set_fetch_refpecs()` and
1273 `git_remote_set_push_refspecs()` have been removed. There is no
1274 longer a way to set the base refspecs at run-time.
1276 * `git_submodule_save()` has been removed. The submodules are no
1277 longer configured via the objects.
1279 * `git_submodule_reload_all()` has been removed as we no longer cache
1282 ### Breaking API changes
1284 * `git_smart_subtransport_cb` now has a `param` parameter.
1286 * The `git_merge_options` structure member `flags` has been renamed
1289 * The `git_merge_file_options` structure member `flags` is now
1290 an unsigned int. It was previously a `git_merge_file_flags_t`.
1292 * `GIT_CHECKOUT_SAFE_CREATE` has been removed. Most users will generally
1293 be able to switch to `GIT_CHECKOUT_SAFE`, but if you require missing
1294 file handling during checkout, you may now use `GIT_CHECKOUT_SAFE |
1295 GIT_CHECKOUT_RECREATE_MISSING`.
1297 * The `git_clone_options` and `git_submodule_update_options`
1298 structures no longer have a `signature` field.
1300 * The following functions have removed the signature and/or log message
1301 parameters in favour of git-emulating ones.
1303 * `git_branch_create()`, `git_branch_move()`
1304 * `git_rebase_init()`, `git_rebase_abort()`
1305 * `git_reference_symbolic_create_matching()`,
1306 `git_reference_symbolic_create()`, `git_reference_create()`,
1307 `git_reference_create_matching()`,
1308 `git_reference_symbolic_set_target()`,
1309 `git_reference_set_target()`, `git_reference_rename()`
1310 * `git_remote_update_tips()`, `git_remote_fetch()`, `git_remote_push()`
1311 * `git_repository_set_head()`,
1312 `git_repository_set_head_detached()`,
1313 `git_repository_detach_head()`
1316 * `git_config_get_entry()` now gives back a ref-counted
1317 `git_config_entry`. You must free it when you no longer need it.
1319 * `git_config_get_string()` will return an error if used on a
1320 non-snapshot configuration, as there can be no guarantee that the
1321 returned pointer is valid.
1323 * `git_note_default_ref()` now uses a `git_buf` to return the string,
1324 as the string is otherwise not guaranteed to stay allocated.
1326 * `git_rebase_operation_current()` will return `GIT_REBASE_NO_OPERATION`
1327 if it is called immediately after creating a rebase session but before
1328 you have applied the first patch.
1330 * `git_rebase_options` now contains a `git_checkout_options` struct
1331 that will be used for functions that modify the working directory,
1332 namely `git_rebase_init`, `git_rebase_next` and
1333 `git_rebase_abort`. As a result, `git_rebase_open` now also takes
1334 a `git_rebase_options` and only the `git_rebase_init` and
1335 `git_rebase_open` functions take a `git_rebase_options`, where they
1336 will persist the options to subsequent `git_rebase` calls.
1338 * The `git_clone_options` struct now has fetch options in a
1339 `fetch_opts` field instead of remote callbacks in
1342 * The remote callbacks has gained a new member `push_negotiation`
1343 which gets called before sending the update commands to the server.
1345 * The following functions no longer act on a remote instance but
1346 change the repository's configuration. Their signatures have changed
1349 * `git_remote_set_url()`, `git_remote_seturl()`
1350 * `git_remote_add_fetch()`, `git_remote_add_push()` and
1351 * `git_remote_set_autotag()`
1353 * `git_remote_connect()` and `git_remote_prune()` now take a pointer
1356 * `git_remote_fetch()` and `git_remote_download()` now take a pointer
1357 to fetch options which determine the runtime configuration.
1359 * The `git_remote_autotag_option_t` values have been changed. It has
1360 gained a `_UNSPECIFIED` default value to specify no override for the
1363 * `git_remote_update_tips()` now takes a pointer to the callbacks as
1364 well as a boolean whether to write `FETCH_HEAD` and the autotag
1367 * `git_remote_create_anonymous()` no longer takes a fetch refspec as
1368 url-only remotes cannot have configured refspecs.
1370 * The `git_submodule_update_options` struct now has fetch options in
1371 the `fetch_opts` field instead of callbacks in the
1372 `remote_callbacks` field.
1374 * The following functions no longer act on a submodule instance but
1375 change the repository's configuration. Their signatures have changed
1378 * `git_submodule_set_url()`, `git_submodule_set_ignore()`,
1379 `git_submodule_set_update()`,
1380 `git_submodule_set_fetch_recurse_submodules()`.
1382 * `git_submodule_status()` no longer takes a submodule instance but a
1383 repsitory, a submodule name and an ignore setting.
1385 * The `push` function in the `git_transport` interface now takes a
1386 pointer to the remote callbacks.
1388 * The `git_index_entry` struct's fields' types have been changed to
1389 more accurately reflect what is in fact stored in the
1390 index. Specifically, time and file size are 32 bits intead of 64, as
1391 these values are truncated.
1393 * `GIT_EMERGECONFLICT` is now `GIT_ECONFLICT`, which more accurately
1394 describes the nature of the error.
1396 * It is no longer allowed to call `git_buf_grow()` on buffers
1397 borrowing the memory they point to.
1402 ### Changes or improvements
1404 * `git_signature_new()` now requires a non-empty email address.
1406 * Use CommonCrypto libraries for SHA-1 calculation on Mac OS X.
1408 * Disable SSL compression and SSLv2 and SSLv3 ciphers in favor of TLSv1
1411 * The fetch behavior of remotes with autotag set to `GIT_REMOTE_DOWNLOAD_TAGS_ALL`
1412 has been changed to match git 1.9.0 and later. In this mode, libgit2 now
1413 fetches all tags in addition to whatever else needs to be fetched.
1415 * `git_checkout()` now handles case-changing renames correctly on
1416 case-insensitive filesystems; for example renaming "readme" to "README".
1418 * The search for libssh2 is now done via pkg-config instead of a
1419 custom search of a few directories.
1421 * Add support for core.protectHFS and core.protectNTFS. Add more
1422 validation for filenames which we write such as references.
1424 * The local transport now generates textual progress output like
1425 git-upload-pack does ("counting objects").
1427 * `git_checkout_index()` can now check out an in-memory index that is not
1428 necessarily the repository's index, so you may check out an index
1429 that was produced by git_merge and friends while retaining the cached
1432 * Remove the default timeout for receiving / sending data over HTTP using
1433 the WinHTTP transport layer.
1435 * Add SPNEGO (Kerberos) authentication using GSSAPI on Unix systems.
1437 * Provide built-in objects for the empty blob (e69de29) and empty
1438 tree (4b825dc) objects.
1440 * The index' tree cache is now filled upon read-tree and write-tree
1441 and the cache is written to disk.
1443 * LF -> CRLF filter refuses to handle mixed-EOL files
1445 * LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)
1447 * File unlocks are atomic again via rename. Read-only files on Windows are
1448 made read-write if necessary.
1450 * Share open packfiles across repositories to share descriptors and mmaps.
1452 * Use a map for the treebuilder, making insertion O(1)
1454 * The build system now accepts an option EMBED_SSH_PATH which when set
1455 tells it to include a copy of libssh2 at the given location. This is
1458 * Add support for refspecs with the asterisk in the middle of a
1461 * Fetching now performs opportunistic updates. To achieve this, we
1462 introduce a difference between active and passive refspecs, which
1463 make `git_remote_download()` and `git_remote_fetch()` to take a list of
1464 resfpecs to be the active list, similarly to how git fetch accepts a
1465 list on the command-line.
1467 * The THREADSAFE option to build libgit2 with threading support has
1468 been flipped to be on by default.
1470 * The remote object has learnt to prune remote-tracking branches. If
1471 the remote is configured to do so, this will happen via
1472 `git_remote_fetch()`. You can also call `git_remote_prune()` after
1473 connecting or fetching to perform the prune.
1478 * Introduce `git_buf_text_is_binary()` and `git_buf_text_contains_nul()` for
1479 consumers to perform binary detection on a git_buf.
1481 * `git_branch_upstream_remote()` has been introduced to provide the
1482 branch.<name>.remote configuration value.
1484 * Introduce `git_describe_commit()` and `git_describe_workdir()` to provide
1485 a description of the current commit (and working tree, respectively)
1486 based on the nearest tag or reference
1488 * Introduce `git_merge_bases()` and the `git_oidarray` type to expose all
1489 merge bases between two commits.
1491 * Introduce `git_merge_bases_many()` to expose all merge bases between
1494 * Introduce rebase functionality (using the merge algorithm only).
1495 Introduce `git_rebase_init()` to begin a new rebase session,
1496 `git_rebase_open()` to open an in-progress rebase session,
1497 `git_rebase_commit()` to commit the current rebase operation,
1498 `git_rebase_next()` to apply the next rebase operation,
1499 `git_rebase_abort()` to abort an in-progress rebase and `git_rebase_finish()`
1500 to complete a rebase operation.
1502 * Introduce `git_note_author()` and `git_note_committer()` to get the author
1503 and committer information on a `git_note`, respectively.
1505 * A factory function for ssh has been added which allows to change the
1506 path of the programs to execute for receive-pack and upload-pack on
1507 the server, `git_transport_ssh_with_paths()`.
1509 * The ssh transport supports asking the remote host for accepted
1510 credential types as well as multiple challeges using a single
1511 connection. This requires to know which username you want to connect
1512 as, so this introduces the USERNAME credential type which the ssh
1513 transport will use to ask for the username.
1515 * The `GIT_EPEEL` error code has been introduced when we cannot peel a tag
1516 to the requested object type; if the given object otherwise cannot be
1517 peeled, `GIT_EINVALIDSPEC` is returned.
1519 * Introduce `GIT_REPOSITORY_INIT_RELATIVE_GITLINK` to use relative paths
1520 when writing gitlinks, as is used by git core for submodules.
1522 * `git_remote_prune()` has been added. See above for description.
1525 * Introduce reference transactions, which allow multiple references to
1526 be locked at the same time and updates be queued. This also allows
1527 us to safely update a reflog with arbitrary contents, as we need to
1532 * `git_remote_supported_url()` and `git_remote_is_valid_url()` have been
1533 removed as they have become essentially useless with rsync-style ssh paths.
1535 * `git_clone_into()` and `git_clone_local_into()` have been removed from the
1536 public API in favour of `git_clone callbacks`.
1538 * The option to ignore certificate errors via `git_remote_cert_check()`
1539 is no longer present. Instead, `git_remote_callbacks` has gained a new
1540 entry which lets the user perform their own certificate checks.
1542 ### Breaking API changes
1544 * `git_cherry_pick()` is now `git_cherrypick()`.
1546 * The `git_submodule_update()` function was renamed to
1547 `git_submodule_update_strategy()`. `git_submodule_update()` is now used to
1548 provide functionalty similar to "git submodule update".
1550 * `git_treebuilder_create()` was renamed to `git_treebuilder_new()` to better
1551 reflect it being a constructor rather than something which writes to
1554 * `git_treebuilder_new()` (was `git_treebuilder_create()`) now takes a
1555 repository so that it can query repository configuration.
1556 Subsequently, `git_treebuilder_write()` no longer takes a repository.
1558 * `git_threads_init()` and `git_threads_shutdown()` have been renamed to
1559 `git_libgit2_init()` and `git_libgit2_shutdown()` to better explain what
1560 their purpose is, as it's grown to be more than just about threads.
1562 * `git_libgit2_init()` and `git_libgit2_shutdown()` now return the number of
1563 initializations of the library, so consumers may schedule work on the
1564 first initialization.
1566 * The `git_transport_register()` function no longer takes a priority and takes
1567 a URL scheme name (eg "http") instead of a prefix like "http://"
1569 * `git_index_name_entrycount()` and `git_index_reuc_entrycount()` now
1570 return size_t instead of unsigned int.
1572 * The `context_lines` and `interhunk_lines` fields in `git_diff`_options are
1573 now `uint32_t` instead of `uint16_t`. This allows to set them to `UINT_MAX`,
1574 in effect asking for "infinite" context e.g. to iterate over all the
1575 unmodified lines of a diff.
1577 * `git_status_file()` now takes an exact path. Use `git_status_list_new()` if
1578 pathspec searching is needed.
1580 * `git_note_create()` has changed the position of the notes reference
1581 name to match `git_note_remove()`.
1583 * Rename `git_remote_load()` to `git_remote_lookup()` to bring it in line
1584 with the rest of the lookup functions.
1586 * `git_remote_rename()` now takes the repository and the remote's
1587 current name. Accepting a remote indicates we want to change it,
1588 which we only did partially. It is much clearer if we accept a name
1589 and no loaded objects are changed.
1591 * `git_remote_delete()` now accepts the repository and the remote's name
1592 instead of a loaded remote.
1594 * `git_merge_head` is now `git_annotated_commit`, to better reflect its usage
1595 for multiple functions (including rebase)
1597 * The `git_clone_options` struct no longer provides the `ignore_cert_errors` or
1598 `remote_name` members for remote customization.
1600 Instead, the `git_clone_options` struct has two new members, `remote_cb` and
1601 `remote_cb_payload`, which allow the caller to completely override the remote
1602 creation process. If needed, the caller can use this callback to give their
1603 remote a name other than the default (origin) or disable cert checking.
1605 The `remote_callbacks` member has been preserved for convenience, although it
1606 is not used when a remote creation callback is supplied.
1608 * The `git_clone`_options struct now provides `repository_cb` and
1609 `repository_cb_payload` to allow the user to create a repository with
1612 * The `git_push` struct to perform a push has been replaced with
1613 `git_remote_upload()`. The refspecs and options are passed as a
1614 function argument. `git_push_update_tips()` is now also
1615 `git_remote_update_tips()` and the callbacks are in the same struct as
1618 * The `git_remote_set_transport()` function now sets a transport factory function,
1619 rather than a pre-existing transport instance.
1621 * The `git_transport` structure definition has moved into the sys/transport.h
1624 * libgit2 no longer automatically sets the OpenSSL locking
1625 functions. This is not something which we can know to do. A
1626 last-resort convenience function is provided in sys/openssl.h,
1627 `git_openssl_set_locking()` which can be used to set the locking.