]> git.proxmox.com Git - libgit2.git/blob - docs/changelog.md
New upstream version 1.1.0+dfsg.1
[libgit2.git] / docs / changelog.md
1 v1.1
2 ----
3
4 This is release v1.1, "Fernweh".
5
6 ### Changes or improvements
7
8 * Our bundled PCRE dependency has been updated to 8.44.
9
10 * The `refs/remotes/origin/HEAD` file will be created at clone time to
11 point to the origin's default branch.
12
13 * libgit2 now uses the `__atomic_` intrinsics instead of `__sync_`
14 intrinsics on supported gcc and clang versions.
15
16 * The `init.defaultBranch` setting is now respected and `master` is
17 no longer the hardcoded as the default branch name.
18
19 * Patch files that do not contain an `index` line can now be parsed.
20
21 * Configuration files with multi-line values can now contain quotes
22 split across multiple lines.
23
24 * Windows clients now attempt to use TLS1.3 when available.
25
26 * Servers that request an upgrade to a newer HTTP version are
27 silently ignored instead of erroneously failing.
28
29 * Users can pass `NULL` to the options argument to
30 `git_describe_commit`.
31
32 * Clones and fetches of very large packfiles now succeeds on 32-bit
33 platforms.
34
35 * Custom reference database backends can now handle the repository's
36 `HEAD` correctly.
37
38 * Repositories with a large number of packfiles no longer exhaust the
39 number of file descriptors.
40
41 * The test framework now supports TAP output when the `-t` flag is
42 specified.
43
44 * The test framework can now specify an exact match to a test
45 function using a trailing `$`.
46
47 * All checkout types support `GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH`.
48
49 * `git_blame` now can ignore whitespace changes using the option
50 `GIT_BLAME_IGNORE_WHITESPACE`.
51
52 * Several new examples have been created, including an examples for
53 commit, add and push.
54
55 * Mode changes during rename are now supported in patch application.
56
57 * `git_checkout_head` now correctly removes untracked files in a
58 subdirectory when the `FORCE | REMOVE_UNTRACKED` options are specified.
59
60 v1.0.1
61 ------
62
63 This is a bugfix release with the following changes:
64
65 - Calculating information about renamed files during merges is more
66 efficient because dissimilarity about files is now being cached and
67 no longer needs to be recomputed.
68
69 - The `git_worktree_prune_init_options` has been correctly restored for
70 backward compatibility. In v1.0 it was incorrectly deprecated with a
71 typo.
72
73 - The optional ntlmclient dependency now supports NetBSD.
74
75 - A bug where attempting to stash on a bare repository may have failed
76 has been fixed.
77
78 - Configuration files that are unreadable due to permissions are now
79 silently ignored, and treated as if they do not exist. This matches
80 git's behavior; previously this case would have been an error.
81
82 - v4 index files are now correctly written; previously we would read
83 them correctly but would not write the prefix-compression accurately,
84 causing corruption.
85
86 - A bug where the smart HTTP transport could not read large data packets
87 has been fixed. Previously, fetching from servers like Gerrit, that
88 sent large data packets, would error.
89
90 v1.0
91 ----
92
93 This is release v1.0 "Luftschloss", which is the first stabe release of
94 libgit2. The API will stay compatible across all releases of the same major
95 version. This release includes bugfixes only and supersedes v0.99, which will
96 stop being maintained. Both v0.27 and v0.28 stay supported in accordance with
97 our release policy.
98
99 ### Changes or improvements
100
101 - CMake was converted to make use of the GNUInstallDirs module for both our
102 pkgconfig and install targets in favor of our custom build options
103 `BIN_INSTALL_DIR`, `LIB_INSTALL_DIR` and `INCLUDE_INSTALL_DIR`. Instead, you
104 can now use CMakes standard variables `CMAKE_INSTALL_BINDIR`,
105 `CMAKE_INSTALL_LIBDIR` and `CMAKE_INSTALL_INCLUDEDIR`.
106
107 - Some CMake build options accepted either a specific value or a boolean value
108 to disable the option altogether or use automatic detection. We only accepted
109 "ON" or "OFF", but none of the other values CMake recognizes as boolean. This
110 was aligned with CMake's understanding of booleans.
111
112 - The installed pkgconfig file contained incorrect values for both `libdir` and
113 `includedir` variables.
114
115 - If using pcre2 for regular expressions, then we incorrectly added "pcre2"
116 instead of "pcre2-8" to our pkgconfig dependencies, which was corrected.
117
118 - Fixed building the bundled ntlmclient dependency on FreeBSD, OpenBSD and
119 SunOS.
120
121 - When writing symlinks on Windows, we incorrectly handled relative symlink
122 targets, which was corrected.
123
124 - When using the HTTP protocol via macOS' SecureTransport implementation, reads
125 could stall at the end of the session and only continue after a timeout of 60
126 seconds was reached.
127
128 - The filesystem-based reference callback didn't corectly initialize the backend
129 version.
130
131 - A segmentation fault was fixed when calling `git_blame_buffer()` for files
132 that were modified and added to the index.
133
134 - A backwards-incompatible change was introduced when we moved some structures
135 from "git2/credentials.h" into "git2/sys/credentials.h". This was fixed in the
136 case where you do not use hard deprecation.
137
138 - Improved error handling in various places.
139
140
141 v0.99
142 -----
143
144 This is v0.99 "Torschlusspanik". This will be the last minor release
145 before libgit2 v1.0. We expect to only respond to bugs in this release,
146 to stabilize it for next major release.
147
148 It contains significant refactorings, but is expected to be API-compatible
149 with v0.28.0.
150
151 ### Changes or improvements
152
153 * When fetching from an anonymous remote using a URL with authentication
154 information provided in the URL (eg `https://foo:bar@example.com/repo`),
155 we would erroneously include the literal URL in the FETCH_HEAD file.
156 We now remove that to match git's behavior.
157
158 * Some credential structures, enums and values have been renamed:
159 `git_cred` is now `git_credential`. `git_credtype_t` is now
160 `git_credential_t`. Functions and types beginning with
161 `git_cred_` now begin with `git_credential`, and constants beginning
162 with `GIT_CREDTYPE` now begin with `GIT_CREDENTIAL`. The former names
163 are deprecated.
164
165 * Several function signatures have been changed to return an `int` to
166 indicate error conditions. We encourage you to check them for errors
167 in the standard way.
168
169 * `git_attr_cache_flush`
170 * `git_error_set_str`
171 * `git_index_name_clear`
172 * `git_index_reuc_clear`
173 * `git_libgit2_version`
174 * `git_mempack_reset`
175 * `git_oid_cpy`
176 * `git_oid_fmt`
177 * `git_oid_fromraw`
178 * `git_oid_nfmt`
179 * `git_oid_pathfmt`
180 * `git_remote_stop`
181 * `git_remote_disconnect`
182 * `git_repository__cleanup`
183 * `git_repository_set_config`
184 * `git_repository_set_index`
185 * `git_repository_set_odb`
186 * `git_repository_set_refdb`
187 * `git_revwalk_reset`
188 * `git_revwalk_simplify_first_parent`
189 * `git_revwalk_sorting`
190 * `git_treebuilder_clear`
191 * `git_treebuilder_filter`
192
193 * The NTLM and Negotiate authentication mechanisms are now supported when
194 talking to git implementations hosted on Apache or nginx servers.
195
196 * The `HEAD` symbolic reference can no longer be deleted.
197
198 * `git_merge_driver_source_repo` no longer returns a `const git_repository *`,
199 it now returns a non-`const` `git_repository *`.
200
201 * Relative symbolic links are now supported on Windows when `core.symlinks`
202 is enabled.
203
204 * Servers that provide query parameters with a redirect are now supported.
205
206 * `git_submodule_sync` will now resolve relative URLs.
207
208 * When creating git endpoint URLs, double-slashes are no longer used when
209 the given git URL has a trailing slash.
210
211 * On Windows, a `DllMain` function is no longer included and thread-local
212 storage has moved to fiber-local storage in order to prevent race
213 conditions during shutdown.
214
215 * The tracing mechanism (`GIT_TRACE`) is now enabled by default and does
216 not need to be explicitly enabled in CMake.
217
218 * The size of Git objects is now represented by `git_object_size_t`
219 instead of `off_t`.
220
221 * Binary patches without data can now be parsed.
222
223 * A configuration snapshot can now be created from another configuration
224 snapshot, not just a "true" configuration object.
225
226 * The `git_commit_with_signature` API will now ensure that referenced
227 objects exist in the object database.
228
229 * Stash messages containing newlines will now be replaced with spaces;
230 they will no longer be (erroneously) written to the repository.
231
232 * `git_commit_create_with_signature` now verifies the commit information
233 to ensure that it points to a valid tree and valid parents.
234
235 * `git_apply` has an option `GIT_APPLY_CHECK` that will only do a dry-run.
236 The index and working directory will remain unmodified, and application
237 will report if it would have worked.
238
239 * Patches produced by Mercurial (those that lack some git extended headers)
240 can now be parsed and applied.
241
242 * Reference locks are obeyed correctly on POSIX platforms, instead of
243 being removed.
244
245 * Patches with empty new files can now be read and applied.
246
247 * `git_apply_to_tree` can now correctly apply patches that add new files.
248
249 * The program data configuration on Windows (`C:\ProgramData\Git\config`)
250 must be owned by an administrator, a system account or the current user
251 to be read.
252
253 * `git_blob_filtered_content` is now deprecated in favor of `git_blob_filter`.
254
255 * Configuration files can now be included conditionally using the
256 `onbranch` conditional.
257
258 * Checkout can now properly create and remove symbolic links to directories
259 on Windows.
260
261 * Stash no longer recomputes trees when committing a worktree, for
262 improved performance.
263
264 * Repository templates can now include a `HEAD` file to default the
265 initial default branch.
266
267 * Some configuration structures, enums and values have been renamed:
268 `git_cvar_map` is now `git_configmap`, `git_cvar_t` is now
269 `git_configmap_t`, `GIT_CVAR_FALSE` is now `GIT_CONFIGMAP_FALSE`,
270 `GIT_CVAR_TRUE` is now `GIT_CONFIGMAP_TRUE`, `GIT_CVAR_INT32` is now
271 `GIT_CONFIGMAP_INT32`, and `GIT_CVAR_STRING` is now `GIT_CONFIGMAP_STRING`.
272 The former names are deprecated.
273
274 * Repositories can now be created at the root of a Windows drive.
275
276 * Configuration lookups are now more efficiently cached.
277
278 * `git_commit_create_with_signature` now supports a `NULL` signature,
279 which will create a commit without adding a signature.
280
281 * When a repository lacks an `info` "common directory", we will no
282 longer erroneously return `GIT_ENOTFOUND` for all attribute lookups.
283
284 * Several attribute macros have been renamed: `GIT_ATTR_TRUE` is now
285 `GIT_ATTR_IS_TRUE`, `GIT_ATTR_FALSE` is now `GIT_ATTR_IS_FALSE`,
286 `GIT_ATTR_UNSPECIFIED` is now `GIT_ATTR_IS_UNSPECIFIED`. The
287 attribute enum `git_attr_t` is now `git_attr_value_t` and its
288 values have been renamed: `GIT_ATTR_UNSPECIFIED_T` is now
289 `GIT_ATTR_VALUE_UNSPECIFIED`, `GIT_ATTR_TRUE_T` is now
290 `GIT_ATTR_VALUE_TRUE`, `GIT_ATTR_FALSE_T` is now `GIT_ATTR_VALUE_FALSE`,
291 and `GIT_ATTR_VALUE_T` is now `GIT_ATTR_VALUE_STRING`. The
292 former names are deprecated.
293
294 * `git_object__size` is now `git_object_size`. The former name is
295 deprecated.
296
297 * `git_tag_create_frombuffer` is now `git_tag_create_from_buffer`. The
298 former name is deprecated.
299
300 * Several blob creation functions have been renamed:
301 `git_blob_create_frombuffer` is now named `git_blob_create_from_buffer`,
302 `git_blob_create_fromdisk` is now named `git_blob_create_from_disk`,
303 `git_blob_create_fromworkdir` is now named `git_blob_create_from_workdir`,
304 `git_blob_create_fromstream` is now named `git_blob_create_from_stream`,
305 and `git_blob_create_fromstream_commit` is now named
306 `git_blob_create_from_stream_commit`. The former names are deprecated.
307
308 * The function `git_oid_iszero` is now named `git_oid_is_zero`. The
309 former name is deprecated.
310
311 * Pattern matching is now done using `wildmatch` instead of `fnmatch`
312 for compatibility with git.
313
314 * The option initialization functions suffixed by `init_options` are now
315 suffixed with `options_init`. (For example, `git_checkout_init_options`
316 is now `git_checkout_options_init`.) The former names are deprecated.
317
318 * NTLM2 authentication is now supported on non-Windows platforms.
319
320 * The `git_cred_sign_callback` callback is now named `git_cred_sign_cb`.
321 The `git_cred_ssh_interactive_callback` callback is now named
322 `git_cred_ssh_interactive_cb`.
323
324 * Ignore files now:
325
326 * honor escaped trailing whitespace.
327 * do not incorrectly negate sibling paths of a negated pattern.
328 * honor rules that stop ignoring files after a wildcard
329
330 * Attribute files now:
331
332 * honor leading and trailing whitespace.
333 * treat paths beginning with `\` as absolute only on Windows.
334 * properly handle escaped characters.
335 * stop reading macros defined in subdirectories
336
337 * The C locale is now correctly used when parsing regular expressions.
338
339 * The system PCRE2 or PCRE regular expression libraries are now used
340 when `regcomp_l` is not available on the system. If none of these
341 are available on the system, an included version of PCRE is used.
342
343 * Wildcards in reference specifications are now supported beyond simply
344 a bare wildcard (`*`) for compatibility with git.
345
346 * When `git_ignore_path_is_ignored` is provided a path with a trailing
347 slash (eg, `dir/`), it will now treat it as a directory for the
348 purposes of ignore matching.
349
350 * Patches that add or remove a file with a space in the path can now
351 be correctly parsed.
352
353 * The `git_remote_completion_type` type is now `git_remote_completion_t`.
354 The former name is deprecated.
355
356 * The `git_odb_backend_malloc` is now `git_odb_backend_data_alloc`. The
357 former name is deprecated.
358
359 * The `git_transfer_progress_cb` callback is now `git_indexer_progress_cb`
360 and the `git_transfer_progress` structure is now `git_indexer_progress`.
361 The former names are deprecated.
362
363 * The example projects are now contained in a single `lg2` executable
364 for ease of use.
365
366 * libgit2 now correctly handles more URLs, such as
367 `http://example.com:/repo.git` (colon but no port),
368 `http://example.com` (no path),
369 and `http://example.com:8080/` (path is /, nonstandard port).
370
371 * A carefully constructed commit object with a very large number
372 of parents may lead to potential out-of-bounds writes or
373 potential denial of service.
374
375 * The ProgramData configuration file is always read for compatibility
376 with Git for Windows and Portable Git installations. The ProgramData
377 location is not necessarily writable only by administrators, so we
378 now ensure that the configuration file is owned by the administrator
379 or the current user.
380
381 ### API additions
382
383 * The SSH host key now supports SHA-256 when `GIT_CERT_SSH_SHA256` is set.
384
385 * The diff format option `GIT_DIFF_FORMAT_PATCH_ID` can now be used to
386 emit an output like `git patch-id`.
387
388 * The `git_apply_options_init` function will initialize a
389 `git_apply_options` structure.
390
391 * The remote callbacks structure adds a `git_url_resolve_cb` callback
392 that is invoked when connecting to a server, so that applications
393 may edit or replace the URL before connection.
394
395 * The information about the original `HEAD` in a rebase operation is
396 available with `git_rebase_orig_head_name`. Its ID is available with
397 `git_rebase_orig_head_id`. The `onto` reference name is available with
398 `git_rebase_onto_name` and its ID is available with `git_rebase_onto_id`.
399
400 * ODB backends can now free backend data when an error occurs during its
401 backend data creation using `git_odb_backend_data_free`.
402
403 * Options may be specified to `git_repository_foreach_head` to control
404 its behavior: `GIT_REPOSITORY_FOREACH_HEAD_SKIP_REPO` will not skip
405 the main repository's HEAD reference, while
406 `GIT_REPOSITORY_FOREACH_HEAD_SKIP_WORKTREES` will now skip the
407 worktree HEAD references.
408
409 * The `GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS` option can be specified to
410 `git_libgit2_opts()` to avoid looking for `.keep` files that correspond
411 to packfiles. This setting can improve performance when packfiles are
412 stored on high-latency filesystems like network filesystems.
413
414 * Blobs can now be filtered with `git_blob_filter`, which allows for
415 options to be set with `git_blob_filter_options`, including
416 `GIT_FILTER_NO_SYSTEM_ATTRIBUTES` to disable filtering with system-level
417 attributes in `/etc/gitattributes` and `GIT_ATTR_CHECK_INCLUDE_HEAD` to
418 enable filtering with `.gitattributes` files in the HEAD revision.
419
420 ### API removals
421
422 * The unused `git_headlist_cb` function declaration was removed.
423
424 * The unused `git_time_monotonic` API is removed.
425
426 * The erroneously exported `inttypes.h` header was removed.
427
428 # Security Fixes
429
430 - CVE-2019-1348: the fast-import stream command "feature
431 export-marks=path" allows writing to arbitrary file paths. As
432 libgit2 does not offer any interface for fast-import, it is not
433 susceptible to this vulnerability.
434
435 - CVE-2019-1349: by using NTFS 8.3 short names, backslashes or
436 alternate filesystreams, it is possible to cause submodules to
437 be written into pre-existing directories during a recursive
438 clone using git. As libgit2 rejects cloning into non-empty
439 directories by default, it is not susceptible to this
440 vulnerability.
441
442 - CVE-2019-1350: recursive clones may lead to arbitrary remote
443 code executing due to improper quoting of command line
444 arguments. As libgit2 uses libssh2, which does not require us
445 to perform command line parsing, it is not susceptible to this
446 vulnerability.
447
448 - CVE-2019-1351: Windows provides the ability to substitute
449 drive letters with arbitrary letters, including multi-byte
450 Unicode letters. To fix any potential issues arising from
451 interpreting such paths as relative paths, we have extended
452 detection of DOS drive prefixes to accomodate for such cases.
453
454 - CVE-2019-1352: by using NTFS-style alternative file streams for
455 the ".git" directory, it is possible to overwrite parts of the
456 repository. While this has been fixed in the past for Windows,
457 the same vulnerability may also exist on other systems that
458 write to NTFS filesystems. We now reject any paths starting
459 with ".git:" on all systems.
460
461 - CVE-2019-1353: by using NTFS-style 8.3 short names, it was
462 possible to write to the ".git" directory and thus overwrite
463 parts of the repository, leading to possible remote code
464 execution. While this problem was already fixed in the past for
465 Windows, other systems accessing NTFS filesystems are
466 vulnerable to this issue too. We now enable NTFS protecions by
467 default on all systems to fix this attack vector.
468
469 - CVE-2019-1354: on Windows, backslashes are not a valid part of
470 a filename but are instead interpreted as directory separators.
471 As other platforms allowed to use such paths, it was possible
472 to write such invalid entries into a Git repository and was
473 thus an attack vector to write into the ".git" dierctory. We
474 now reject any entries starting with ".git\" on all systems.
475
476 - CVE-2019-1387: it is possible to let a submodule's git
477 directory point into a sibling's submodule directory, which may
478 result in overwriting parts of the Git repository and thus lead
479 to arbitrary command execution. As libgit2 doesn't provide any
480 way to do submodule clones natively, it is not susceptible to
481 this vulnerability. Users of libgit2 that have implemented
482 recursive submodule clones manually are encouraged to review
483 their implementation for this vulnerability.
484
485 ### Breaking API changes
486
487 * The "private" implementation details of the `git_cred` structure have been
488 moved to a dedicated `git2/sys/cred.h` header, to clarify that the underlying
489 structures are only provided for custom transport implementers.
490 The breaking change is that the `username` member of the underlying struct
491 is now hidden, and a new `git_cred_get_username` function has been provided.
492
493 ### Breaking CMake configuration changes
494
495 * The CMake option to use a system http-parser library, instead of the
496 bundled dependency, has changed. This is due to a deficiency in
497 http-parser that we have fixed in our implementation. The bundled
498 library is now the default, but if you wish to force the use of the
499 system http-parser implementation despite incompatibilities, you can
500 specify `-DUSE_HTTP_PARSER=system` to CMake.
501
502 * The interactions between `USE_HTTPS` and `SHA1_BACKEND` have been
503 streamlined. The detection was moved to a new `USE_SHA1`, modeled after
504 `USE_HTTPS`, which takes the values "CollisionDetection/Backend/Generic", to
505 better match how the "hashing backend" is selected, the default (ON) being
506 "CollisionDetection". If you were using `SHA1_BACKEND` previously, you'll
507 need to check the value you've used, or switch to the autodetection.
508
509 ### Authors
510
511 The following individuals provided changes that were included in this
512 release:
513
514 * Aaron Patterson
515 * Alberto Fanjul
516 * Anders Borum
517 * Augie Fackler
518 * Augustin Fabre
519 * Ayush Shridhar
520 * brian m. carlson
521 * buddyspike
522 * Carlos Martín Nieto
523 * cheese1
524 * Dan Skorupski
525 * Daniel Cohen Gindi
526 * Dave Lee
527 * David Brooks
528 * David Turner
529 * Denis Laxalde
530 * Dhruva Krishnamurthy
531 * Dominik Ritter
532 * Drew DeVault
533 * Edward Thomson
534 * Eric Huss
535 * Erik Aigner
536 * Etienne Samson
537 * Gregory Herrero
538 * Heiko Voigt
539 * Ian Hattendorf
540 * Jacques Germishuys
541 * Janardhan Pulivarthi
542 * Jason Haslam
543 * Johannes Schindelin
544 * Jordan Wallet
545 * Josh Bleecher Snyder
546 * kas
547 * kdj0c
548 * Laurence McGlashan
549 * lhchavez
550 * Lukas Berk
551 * Max Kostyukevich
552 * Patrick Steinhardt
553 * pcpthm
554 * Remy Suen
555 * Robert Coup
556 * romkatv
557 * Scott Furry
558 * Sebastian Henke
559 * Stefan Widgren
560 * Steve King Jr
561 * Sven Strickroth
562 * Tobias Nießen
563 * Tyler Ang-Wanek
564 * Tyler Wanek
565
566 v0.28
567 -----
568
569 ### Changes or improvements
570
571 * The library is now always built with cdecl calling conventions on
572 Windows; the ability to build a stdcall library has been removed.
573
574 * Reference log creation now honors `core.logallrefupdates=always`.
575
576 * Fix some issues with the error-reporting in the OpenSSL backend.
577
578 * HTTP proxy support is now builtin; libcurl is no longer used to support
579 proxies and is removed as a dependency.
580
581 * Certificate and credential callbacks can now return `GIT_PASSTHROUGH`
582 to decline to act; libgit2 will behave as if there was no callback set
583 in the first place.
584
585 * The line-ending filtering logic - when checking out files - has been
586 updated to match newer git (>= git 2.9) for proper interoperability.
587
588 * Symbolic links are now supported on Windows when `core.symlinks` is set
589 to `true`.
590
591 * Submodules with names which attempt to perform path traversal now have their
592 configuration ignored. Such names were blindly appended to the
593 `$GIT_DIR/modules` and a malicious name could lead to an attacker writing to
594 an arbitrary location. This matches git's handling of CVE-2018-11235.
595
596 * Object validation is now performed during tree creation in the
597 `git_index_write_tree_to` API.
598
599 * Configuration variable may now be specified on the same line as a section
600 header; previously this was erroneously a parser error.
601
602 * When an HTTP server supports both NTLM and Negotiate authentication
603 mechanisms, we would previously fail to authenticate with any mechanism.
604
605 * The `GIT_OPT_SET_PACK_MAX_OBJECTS` option can now set the maximum
606 number of objects allowed in a packfile being downloaded; this can help
607 limit the maximum memory used when fetching from an untrusted remote.
608
609 * Line numbers in diffs loaded from patch files were not being populated;
610 they are now included in the results.
611
612 * The repository's index is reloaded from disk at the beginning of
613 `git_merge` operations to ensure that it is up-to-date.
614
615 * Mailmap handling APIs have been introduced, and the new commit APIs
616 `git_commit_committer_with_mailmap` and `git_commit_author_with_mailmap`
617 will use the mailmap to resolve the committer and author information.
618 In addition, blame will use the mailmap given when the
619 `GIT_BLAME_USE_MAILMAP` option.
620
621 * Ignore handling for files in ignored folders would be ignored.
622
623 * Worktrees can now be backed by bare repositories.
624
625 * Trailing spaces are supported in `.gitignore` files, these spaces were
626 previously (and erroneously) treated as part of the pattern.
627
628 * The library can now be built with mbedTLS support for HTTPS.
629
630 * The diff status character 'T' will now be presented by the
631 `git_diff_status_char` API for diff entries that change type.
632
633 * Revision walks previously would sometimes include commits that should
634 have been ignored; this is corrected.
635
636 * Revision walks are now more efficient when the output is unsorted;
637 we now avoid walking all the way to the beginning of history unnecessarily.
638
639 * Error-handling around index extension loading has been fixed. We were
640 previously always misreporting a truncated index (#4858).
641
642 ### API additions
643
644 * The index may now be iterated atomically using `git_index_iterator`.
645
646 * Remote objects can now be created with extended options using the
647 `git_remote_create_with_opts` API.
648
649 * Diff objects can now be applied as changes to the working directory,
650 index or both, emulating the `git apply` command. Additionally,
651 `git_apply_to_tree` can apply those changes to a tree object as a
652 fully in-memory operation.
653
654 * You can now swap out memory allocators via the
655 `GIT_OPT_SET_ALLOCATOR` option with `git_libgit2_opts()`.
656
657 * You can now ensure that functions do not discard unwritten changes to the
658 index via the `GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY` option to
659 `git_libgit2_opts()`. This will cause functions that implicitly re-read
660 the index (eg, `git_checkout`) to fail if you have staged changes to the
661 index but you have not written the index to disk. (Unless the checkout
662 has the FORCE flag specified.)
663
664 At present, this defaults to off, but we intend to enable this more
665 broadly in the future, as a warning or error. We encourage you to
666 examine your code to ensure that you are not relying on the current
667 behavior that implicitly removes staged changes.
668
669 * Reference specifications can be parsed from an arbitrary string with
670 the `git_refspec_parse` API.
671
672 * You can now get the name and path of worktrees using the
673 `git_worktree_name` and `git_worktree_path` APIs, respectively.
674
675 * The `ref` field has been added to `git_worktree_add_options` to enable
676 the creation of a worktree from a pre-existing branch.
677
678 * It's now possible to analyze merge relationships between any two
679 references, not just against `HEAD`, using `git_merge_analysis_for_ref`.
680
681 ### API removals
682
683 * The `git_buf_free` API is deprecated; it has been renamed to
684 `git_buf_dispose` for consistency. The `git_buf_free` API will be
685 retained for backward compatibility for the foreseeable future.
686
687 * The `git_otype` enumeration and its members are deprecated and have
688 been renamed for consistency. The `GIT_OBJ_` enumeration values are
689 now prefixed with `GIT_OBJECT_`. The old enumerations and macros
690 will be retained for backward compatibility for the foreseeable future.
691
692 * Several index-related APIs have been renamed for consistency. The
693 `GIT_IDXENTRY_` enumeration values and macros have been renamed to
694 be prefixed with `GIT_INDEX_ENTRY_`. The `GIT_INDEXCAP` enumeration
695 values are now prefixed with `GIT_INDEX_CAPABILITY_`. The old
696 enumerations and macros will be retained for backward compatibility
697 for the foreseeable future.
698
699 * The error functions and enumeration values have been renamed for
700 consistency. The `giterr_` functions and values prefix have been
701 renamed to be prefixed with `git_error_`; similarly, the `GITERR_`
702 constants have been renamed to be prefixed with `GIT_ERROR_`.
703 The old enumerations and macros will be retained for backward
704 compatibility for the foreseeable future.
705
706 ### Breaking API changes
707
708 * The default checkout strategy changed from `DRY_RUN` to `SAFE` (#4531).
709
710 * Adding a symlink as .gitmodules into the index from the workdir or checking
711 out such files is not allowed as this can make a Git implementation write
712 outside of the repository and bypass the fsck checks for CVE-2018-11235.
713
714 v0.27
715 ---------
716
717 ### Changes or improvements
718
719 * Improved `p_unlink` in `posix_w32.c` to try and make a file writable
720 before sleeping in the retry loop to prevent unnecessary calls to sleep.
721
722 * The CMake build infrastructure has been improved to speed up building time.
723
724 * A new CMake option "-DUSE_HTTPS=<backend>" makes it possible to explicitly
725 choose an HTTP backend.
726
727 * A new CMake option "-DSHA1_BACKEND=<backend>" makes it possible to explicitly
728 choose an SHA1 backend. The collision-detecting backend is now the default.
729
730 * A new CMake option "-DUSE_BUNDLED_ZLIB" makes it possible to explicitly use
731 the bundled zlib library.
732
733 * A new CMake option "-DENABLE_REPRODUCIBLE_BUILDS" makes it possible to
734 generate a reproducible static archive. This requires support from your
735 toolchain.
736
737 * The minimum required CMake version has been bumped to 2.8.11.
738
739 * Writing to a configuration file now preserves the case of the key given by the
740 caller for the case-insensitive portions of the key (existing sections are
741 used even if they don't match).
742
743 * We now support conditional includes in configuration files.
744
745 * Fix for handling re-reading of configuration files with includes.
746
747 * Fix for reading patches which contain exact renames only.
748
749 * Fix for reading patches with whitespace in the compared files' paths.
750
751 * We will now fill `FETCH_HEAD` from all passed refspecs instead of overwriting
752 with the last one.
753
754 * There is a new diff option, `GIT_DIFF_INDENT_HEURISTIC` which activates a
755 heuristic which takes into account whitespace and indentation in order to
756 produce better diffs when dealing with ambiguous diff hunks.
757
758 * Fix for pattern-based ignore rules where files ignored by a rule cannot be
759 un-ignored by another rule.
760
761 * Sockets opened by libgit2 are now being closed on exec(3) if the platform
762 supports it.
763
764 * Fix for peeling annotated tags from packed-refs files.
765
766 * Fix reading huge loose objects from the object database.
767
768 * Fix files not being treated as modified when only the file mode has changed.
769
770 * We now explicitly reject adding submodules to the index via
771 `git_index_add_frombuffer`.
772
773 * Fix handling of `GIT_DIFF_FIND_RENAMES_FROM_REWRITES` raising `SIGABRT` when
774 one file has been deleted and another file has been rewritten.
775
776 * Fix for WinHTTP not properly handling NTLM and Negotiate challenges.
777
778 * When using SSH-based transports, we now repeatedly ask for the passphrase to
779 decrypt the private key in case a wrong passphrase is being provided.
780
781 * When generating conflict markers, they will now use the same line endings as
782 the rest of the file.
783
784 ### API additions
785
786 * The `git_merge_file_options` structure now contains a new setting,
787 `marker_size`. This allows users to set the size of markers that
788 delineate the sides of merged files in the output conflict file.
789 By default this is 7 (`GIT_MERGE_CONFLICT_MARKER_SIZE`), which
790 produces output markers like `<<<<<<<` and `>>>>>>>`.
791
792 * `git_remote_create_detached()` creates a remote that is not associated
793 to any repository (and does not apply configuration like 'insteadof' rules).
794 This is mostly useful for e.g. emulating `git ls-remote` behavior.
795
796 * `git_diff_patchid()` lets you generate patch IDs for diffs.
797
798 * `git_status_options` now has an additional field `baseline` to allow creating
799 status lists against different trees.
800
801 * New family of functions to allow creating notes for a specific notes commit
802 instead of for a notes reference.
803
804 * New family of functions to allow parsing message trailers. This API is still
805 experimental and may change in future releases.
806
807 ### API removals
808
809 ### Breaking API changes
810
811 * Signatures now distinguish between +0000 and -0000 UTC offsets.
812
813 * The certificate check callback in the WinHTTP transport will now receive the
814 `message_cb_payload` instead of the `cred_acquire_payload`.
815
816 * We are now reading symlinked directories under .git/refs.
817
818 * We now refuse creating branches named "HEAD".
819
820 * We now refuse reading and writing all-zero object IDs into the
821 object database.
822
823 * We now read the effective user's configuration file instead of the real user's
824 configuration in case libgit2 runs as part of a setuid binary.
825
826 * The `git_odb_open_rstream` function and its `readstream` callback in the
827 `git_odb_backend` interface have changed their signatures to allow providing
828 the object's size and type to the caller.
829
830 v0.26
831 -----
832
833 ### Changes or improvements
834
835 * Support for opening, creating and modifying worktrees.
836
837 * We can now detect SHA1 collisions resulting from the SHAttered attack. These
838 checks can be enabled at build time via `-DUSE_SHA1DC`.
839
840 * Fix for missing implementation of `git_merge_driver_source` getters.
841
842 * Fix for installed pkg-config file being broken when the prefix contains
843 spaces.
844
845 * We now detect when the hashsum of on-disk objects does not match their
846 expected hashsum.
847
848 * We now support open-ended ranges (e.g. "master..", "...master") in our
849 revision range parsing code.
850
851 * We now correctly compute ignores with leading "/" in subdirectories.
852
853 * We now optionally call `fsync` on loose objects, packfiles and their indexes,
854 loose references and packed reference files.
855
856 * We can now build against OpenSSL v1.1 and against LibreSSL.
857
858 * `GIT_MERGE_OPTIONS_INIT` now includes a setting to perform rename detection.
859 This aligns this structure with the default by `git_merge` and
860 `git_merge_trees` when `NULL` was provided for the options.
861
862 * Improvements for reading index v4 files.
863
864 * Perform additional retries for filesystem operations on Windows when files
865 are temporarily locked by other processes.
866
867 ### API additions
868
869 * New family of functions to handle worktrees:
870
871 * `git_worktree_list()` lets you look up worktrees for a repository.
872 * `git_worktree_lookup()` lets you get a specific worktree.
873 * `git_worktree_open_from_repository()` lets you get the associated worktree
874 of a repository.
875 a worktree.
876 * `git_worktree_add` lets you create new worktrees.
877 * `git_worktree_prune` lets you remove worktrees from disk.
878 * `git_worktree_lock()` and `git_worktree_unlock()` let you lock
879 respectively unlock a worktree.
880 * `git_repository_open_from_worktree()` lets you open a repository via
881 * `git_repository_head_for_worktree()` lets you get the current `HEAD` for a
882 linked worktree.
883 * `git_repository_head_detached_for_worktree()` lets you check whether a
884 linked worktree is in detached HEAD mode.
885
886 * `git_repository_item_path()` lets you retrieve paths for various repository
887 files.
888
889 * `git_repository_commondir()` lets you retrieve the common directory of a
890 repository.
891
892 * `git_branch_is_checked_out()` allows you to check whether a branch is checked
893 out in a repository or any of its worktrees.
894
895 * `git_repository_submodule_cache_all()` and
896 `git_repository_submodule_cache_clear()` functions allow you to prime or clear
897 the submodule cache of a repository.
898
899 * You can disable strict hash verifications via the
900 `GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION` option with `git_libgit2_opts()`.
901
902 * You can enable us calling `fsync` for various files inside the ".git"
903 directory by setting the `GIT_OPT_ENABLE_FSYNC_GITDIR` option with
904 `git_libgit2_opts()`.
905
906 * You can now enable "offset deltas" when creating packfiles and negotiating
907 packfiles with a remote server by setting `GIT_OPT_ENABLE_OFS_DELTA` option
908 with `GIT_libgit2_opts()`.
909
910 * You can now set the default share mode on Windows for opening files using
911 `GIT_OPT_SET_WINDOWS_SHAREMODE` option with `git_libgit2_opts()`.
912 You can query the current share mode with `GIT_OPT_GET_WINDOWS_SHAREMODE`.
913
914 * `git_transport_smart_proxy_options()' enables you to get the proxy options for
915 smart transports.
916
917 * The `GIT_FILTER_INIT` macro and the `git_filter_init` function are provided
918 to initialize a `git_filter` structure.
919
920 ### Breaking API changes
921
922 * `clone_checkout_strategy` has been removed from
923 `git_submodule_update_option`. The checkout strategy used to clone will
924 be the same strategy specified in `checkout_opts`.
925
926 v0.25
927 -------
928
929 ### Changes or improvements
930
931 * Fix repository discovery with `git_repository_discover` and
932 `git_repository_open_ext` to match git's handling of a ceiling
933 directory at the current directory. git only checks ceiling
934 directories when its search ascends to a parent directory. A ceiling
935 directory matching the starting directory will not prevent git from
936 finding a repository in the starting directory or a parent directory.
937
938 * Do not fail when deleting remotes in the presence of broken
939 global configs which contain branches.
940
941 * Support for reading and writing git index v4 files
942
943 * Improve the performance of the revwalk and bring us closer to git's code.
944
945 * The reference db has improved support for concurrency and returns `GIT_ELOCKED`
946 when an operation could not be performed due to locking.
947
948 * Nanosecond resolution is now activated by default, following git's change to
949 do this.
950
951 * We now restrict the set of ciphers we let OpenSSL use by default.
952
953 * Users can now register their own merge drivers for use with `.gitattributes`.
954 The library also gained built-in support for the union merge driver.
955
956 * The default for creating references is now to validate that the object does
957 exist.
958
959 * Add `git_proxy_options` which is used by the different networking
960 implementations to let the caller specify the proxy settings instead of
961 relying on the environment variables.
962
963 ### API additions
964
965 * You can now get the user-agent used by libgit2 using the
966 `GIT_OPT_GET_USER_AGENT` option with `git_libgit2_opts()`.
967 It is the counterpart to `GIT_OPT_SET_USER_AGENT`.
968
969 * The `GIT_OPT_SET_SSL_CIPHERS` option for `git_libgit2_opts()` lets you specify
970 a custom list of ciphers to use for OpenSSL.
971
972 * `git_commit_create_buffer()` creates a commit and writes it into a
973 user-provided buffer instead of writing it into the object db. Combine it with
974 `git_commit_create_with_signature()` in order to create a commit with a
975 cryptographic signature.
976
977 * `git_blob_create_fromstream()` and
978 `git_blob_create_fromstream_commit()` allow you to create a blob by
979 writing into a stream. Useful when you do not know the final size or
980 want to copy the contents from another stream.
981
982 * New flags for `git_repository_open_ext`:
983
984 * `GIT_REPOSITORY_OPEN_NO_DOTGIT` - Do not check for a repository by
985 appending `/.git` to the `start_path`; only open the repository if
986 `start_path` itself points to the git directory.
987 * `GIT_REPOSITORY_OPEN_FROM_ENV` - Find and open a git repository,
988 respecting the environment variables used by the git command-line
989 tools. If set, `git_repository_open_ext` will ignore the other
990 flags and the `ceiling_dirs` argument, and will allow a NULL
991 `path` to use `GIT_DIR` or search from the current directory. The
992 search for a repository will respect `$GIT_CEILING_DIRECTORIES`
993 and `$GIT_DISCOVERY_ACROSS_FILESYSTEM`. The opened repository
994 will respect `$GIT_INDEX_FILE`, `$GIT_NAMESPACE`,
995 `$GIT_OBJECT_DIRECTORY`, and `$GIT_ALTERNATE_OBJECT_DIRECTORIES`.
996 In the future, this flag will also cause `git_repository_open_ext`
997 to respect `$GIT_WORK_TREE` and `$GIT_COMMON_DIR`; currently,
998 `git_repository_open_ext` with this flag will error out if either
999 `$GIT_WORK_TREE` or `$GIT_COMMON_DIR` is set.
1000
1001 * `git_diff_from_buffer()` can create a `git_diff` object from the contents
1002 of a git-style patch file.
1003
1004 * `git_index_version()` and `git_index_set_version()` to get and set
1005 the index version
1006
1007 * `git_odb_expand_ids()` lets you check for the existence of multiple
1008 objects at once.
1009
1010 * The new `git_blob_dup()`, `git_commit_dup()`, `git_tag_dup()` and
1011 `git_tree_dup()` functions provide type-specific wrappers for
1012 `git_object_dup()` to reduce noise and increase type safety for callers.
1013
1014 * `git_reference_dup()` lets you duplicate a reference to aid in ownership
1015 management and cleanup.
1016
1017 * `git_signature_from_buffer()` lets you create a signature from a string in the
1018 format that appear in objects.
1019
1020 * `git_tree_create_updated()` lets you create a tree based on another one
1021 together with a list of updates. For the covered update cases, it's more
1022 efficient than the `git_index` route.
1023
1024 * `git_apply_patch()` applies hunks from a `git_patch` to a buffer.
1025
1026 * `git_diff_to_buf()` lets you print an entire diff directory to a buffer,
1027 similar to how `git_patch_to_buf()` works.
1028
1029 * `git_proxy_init_options()` is added to initialize a `git_proxy_options`
1030 structure at run-time.
1031
1032 * `git_merge_driver_register()`, `git_merge_driver_unregister()` let you
1033 register and unregister a custom merge driver to be used when `.gitattributes`
1034 specifies it.
1035
1036 * `git_merge_driver_lookup()` can be used to look up a merge driver by name.
1037
1038 * `git_merge_driver_source_repo()`, `git_merge_driver_source_ancestor()`,
1039 `git_merge_driver_source_ours()`, `git_merge_driver_source_theirs()`,
1040 `git_merge_driver_source_file_options()` added as accessors to
1041 `git_merge_driver_source`.
1042
1043 ### API removals
1044
1045 * `git_blob_create_fromchunks()` has been removed in favour of
1046 `git_blob_create_fromstream()`.
1047
1048 ### Breaking API changes
1049
1050 * `git_packbuilder_object_count` and `git_packbuilder_written` now
1051 return a `size_t` instead of a `uint32_t` for more thorough
1052 compatibility with the rest of the library.
1053
1054 * `git_packbuiler_progress` now provides explicitly sized `uint32_t`
1055 values instead of `unsigned int`.
1056
1057 * `git_diff_file` now includes an `id_abbrev` field that reflects the
1058 number of nibbles set in the `id` field.
1059
1060 * `git_odb_backend` now has a `freshen` function pointer. This optional
1061 function pointer is similar to the `exists` function, but it will update
1062 a last-used marker. For filesystem-based object databases, this updates
1063 the timestamp of the file containing the object, to indicate "freshness".
1064 If this is `NULL`, then it will not be called and the `exists` function
1065 will be used instead.
1066
1067 * `git_remote_connect()` now accepts `git_proxy_options` argument, and
1068 `git_fetch_options` and `git_push_options` each have a `proxy_opts` field.
1069
1070 * `git_merge_options` now provides a `default_driver` that can be used
1071 to provide the name of a merge driver to be used to handle files changed
1072 during a merge.
1073
1074 v0.24
1075 -------
1076
1077 ### Changes or improvements
1078
1079 * Custom merge drivers can now be registered, which allows callers to
1080 configure callbacks to honor `merge=driver` configuration in
1081 `.gitattributes`.
1082
1083 * Custom filters can now be registered with wildcard attributes, for
1084 example `filter=*`. Consumers should examine the attributes parameter
1085 of the `check` function for details.
1086
1087 * Symlinks are now followed when locking a file, which can be
1088 necessary when multiple worktrees share a base repository.
1089
1090 * You can now set your own user-agent to be sent for HTTP requests by
1091 using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`.
1092
1093 * You can set custom HTTP header fields to be sent along with requests
1094 by passing them in the fetch and push options.
1095
1096 * Tree objects are now assumed to be sorted. If a tree is not
1097 correctly formed, it will give bad results. This is the git approach
1098 and cuts a significant amount of time when reading the trees.
1099
1100 * Filter registration is now protected against concurrent
1101 registration.
1102
1103 * Filenames which are not valid on Windows in an index no longer cause
1104 to fail to parse it on that OS.
1105
1106 * Rebases can now be performed purely in-memory, without touching the
1107 repository's workdir.
1108
1109 * When adding objects to the index, or when creating new tree or commit
1110 objects, the inputs are validated to ensure that the dependent objects
1111 exist and are of the correct type. This object validation can be
1112 disabled with the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION option.
1113
1114 * The WinHTTP transport's handling of bad credentials now behaves like
1115 the others, asking for credentials again.
1116
1117 ### API additions
1118
1119 * `git_config_lock()` has been added, which allow for
1120 transactional/atomic complex updates to the configuration, removing
1121 the opportunity for concurrent operations and not committing any
1122 changes until the unlock.
1123
1124 * `git_diff_options` added a new callback `progress_cb` to report on the
1125 progress of the diff as files are being compared. The documentation of
1126 the existing callback `notify_cb` was updated to reflect that it only
1127 gets called when new deltas are added to the diff.
1128
1129 * `git_fetch_options` and `git_push_options` have gained a `custom_headers`
1130 field to set the extra HTTP header fields to send.
1131
1132 * `git_stream_register_tls()` lets you register a callback to be used
1133 as the constructor for a TLS stream instead of the libgit2 built-in
1134 one.
1135
1136 * `git_commit_header_field()` allows you to look up a specific header
1137 field in a commit.
1138
1139 * `git_commit_extract_signature()` extracts the signature from a
1140 commit and gives you both the signature and the signed data so you
1141 can verify it.
1142
1143 ### API removals
1144
1145 * No APIs were removed in this version.
1146
1147 ### Breaking API changes
1148
1149 * The `git_merge_tree_flag_t` is now `git_merge_flag_t`. Subsequently,
1150 its members are no longer prefixed with `GIT_MERGE_TREE_FLAG` but are
1151 now prefixed with `GIT_MERGE_FLAG`, and the `tree_flags` field of the
1152 `git_merge_options` structure is now named `flags`.
1153
1154 * The `git_merge_file_flags_t` enum is now `git_merge_file_flag_t` for
1155 consistency with other enum type names.
1156
1157 * `git_cert` descendent types now have a proper `parent` member
1158
1159 * It is the responsibility of the refdb backend to decide what to do
1160 with the reflog on ref deletion. The file-based backend must delete
1161 it, a database-backed one may wish to archive it.
1162
1163 * `git_config_backend` has gained two entries. `lock` and `unlock`
1164 with which to implement the transactional/atomic semantics for the
1165 configuration backend.
1166
1167 * `git_index_add` and `git_index_conflict_add()` will now use the case
1168 as provided by the caller on case insensitive systems. Previous
1169 versions would keep the case as it existed in the index. This does
1170 not affect the higher-level `git_index_add_bypath` or
1171 `git_index_add_frombuffer` functions.
1172
1173 * The `notify_payload` field of `git_diff_options` was renamed to `payload`
1174 to reflect that it's also the payload for the new progress callback.
1175
1176 * The `git_config_level_t` enum has gained a higher-priority value
1177 `GIT_CONFIG_LEVEL_PROGRAMDATA` which represent a rough Windows equivalent
1178 to the system level configuration.
1179
1180 * `git_rebase_options` now has a `merge_options` field.
1181
1182 * The index no longer performs locking itself. This is not something
1183 users of the library should have been relying on as it's not part of
1184 the concurrency guarantees.
1185
1186 * `git_remote_connect()` now takes a `custom_headers` argument to set
1187 the extra HTTP header fields to send.
1188
1189 v0.23
1190 ------
1191
1192 ### Changes or improvements
1193
1194 * Patience and minimal diff drivers can now be used for merges.
1195
1196 * Merges can now ignore whitespace changes.
1197
1198 * Updated binary identification in CRLF filtering to avoid false positives in
1199 UTF-8 files.
1200
1201 * Rename and copy detection is enabled for small files.
1202
1203 * Checkout can now handle an initial checkout of a repository, making
1204 `GIT_CHECKOUT_SAFE_CREATE` unnecessary for users of clone.
1205
1206 * The signature parameter in the ref-modifying functions has been
1207 removed. Use `git_repository_set_ident()` and
1208 `git_repository_ident()` to override the signature to be used.
1209
1210 * The local transport now auto-scales the number of threads to use
1211 when creating the packfile instead of sticking to one.
1212
1213 * Reference renaming now uses the right id for the old value.
1214
1215 * The annotated version of branch creation, HEAD detaching and reset
1216 allow for specifying the expression from the user to be put into the
1217 reflog.
1218
1219 * `git_rebase_commit` now returns `GIT_EUNMERGED` when you attempt to
1220 commit with unstaged changes.
1221
1222 * On Mac OS X, we now use SecureTransport to provide the cryptographic
1223 support for HTTPS connections insead of OpenSSL.
1224
1225 * Checkout can now accept an index for the baseline computations via the
1226 `baseline_index` member.
1227
1228 * The configuration for fetching is no longer stored inside the
1229 `git_remote` struct but has been moved to a `git_fetch_options`. The
1230 remote functions now take these options or the callbacks instead of
1231 setting them beforehand.
1232
1233 * `git_submodule` instances are no longer cached or shared across
1234 lookup. Each submodule represents the configuration at the time of
1235 loading.
1236
1237 * The index now uses diffs for `add_all()` and `update_all()` which
1238 gives it a speed boost and closer semantics to git.
1239
1240 * The ssh transport now reports the stderr output from the server as
1241 the error message, which allows you to get the "repository not
1242 found" messages.
1243
1244 * `git_index_conflict_add()` will remove staged entries that exist for
1245 conflicted paths.
1246
1247 * The flags for a `git_diff_file` will now have the `GIT_DIFF_FLAG_EXISTS`
1248 bit set when a file exists on that side of the diff. This is useful
1249 for understanding whether a side of the diff exists in the presence of
1250 a conflict.
1251
1252 * The constructor for a write-stream into the odb now takes
1253 `git_off_t` instead of `size_t` for the size of the blob, which
1254 allows putting large files into the odb on 32-bit systems.
1255
1256 * The remote's push and pull URLs now honor the url.$URL.insteadOf
1257 configuration. This allows modifying URL prefixes to a custom
1258 value via gitconfig.
1259
1260 * `git_diff_foreach`, `git_diff_blobs`, `git_diff_blob_to_buffer`,
1261 and `git_diff_buffers` now accept a new binary callback of type
1262 `git_diff_binary_cb` that includes the binary diff information.
1263
1264 * The race condition mitigations described in `racy-git.txt` have been
1265 implemented.
1266
1267 * If libcurl is installed, we will use it to connect to HTTP(S)
1268 servers.
1269
1270 ### API additions
1271
1272 * The `git_merge_options` gained a `file_flags` member.
1273
1274 * Parsing and retrieving a configuration value as a path is exposed
1275 via `git_config_parse_path()` and `git_config_get_path()`
1276 respectively.
1277
1278 * `git_repository_set_ident()` and `git_repository_ident()` serve to
1279 set and query which identity will be used when writing to the
1280 reflog.
1281
1282 * `git_config_entry_free()` frees a config entry.
1283
1284 * `git_config_get_string_buf()` provides a way to safely retrieve a
1285 string from a non-snapshot configuration.
1286
1287 * `git_annotated_commit_from_revspec()` allows to get an annotated
1288 commit from an extended sha synatx string.
1289
1290 * `git_repository_set_head_detached_from_annotated()`,
1291 `git_branch_create_from_annotated()` and
1292 `git_reset_from_annotated()` allow for the caller to provide an
1293 annotated commit through which they can control what expression is
1294 put into the reflog as the source/target.
1295
1296 * `git_index_add_frombuffer()` can now create a blob from memory
1297 buffer and add it to the index which is attached to a repository.
1298
1299 * The structure `git_fetch_options` has been added to determine the
1300 runtime configuration for fetching, such as callbacks, pruning and
1301 autotag behaviour. It has the runtime initializer
1302 `git_fetch_init_options()`.
1303
1304 * The enum `git_fetch_prune_t` has been added, letting you specify the
1305 pruning behaviour for a fetch.
1306
1307 * A push operation will notify the caller of what updates it indends
1308 to perform on the remote, which provides similar information to
1309 git's pre-push hook.
1310
1311 * `git_stash_apply()` can now apply a stashed state from the stash list,
1312 placing the data into the working directory and index.
1313
1314 * `git_stash_pop()` will apply a stashed state (like `git_stash_apply()`)
1315 but will remove the stashed state after a successful application.
1316
1317 * A new error code `GIT_EEOF` indicates an early EOF from the
1318 server. This typically indicates an error with the URL or
1319 configuration of the server, and tools can use this to show messages
1320 about failing to communicate with the server.
1321
1322 * A new error code `GIT_EINVALID` indicates that an argument to a
1323 function is invalid, or an invalid operation was requested.
1324
1325 * `git_diff_index_to_workdir()` and `git_diff_tree_to_index()` will now
1326 produce deltas of type `GIT_DELTA_CONFLICTED` to indicate that the index
1327 side of the delta is a conflict.
1328
1329 * The `git_status` family of functions will now produce status of type
1330 `GIT_STATUS_CONFLICTED` to indicate that a conflict exists for that file
1331 in the index.
1332
1333 * `git_index_entry_is_conflict()` is a utility function to determine if
1334 a given index entry has a non-zero stage entry, indicating that it is
1335 one side of a conflict.
1336
1337 * It is now possible to pass a keypair via a buffer instead of a
1338 path. For this, `GIT_CREDTYPE_SSH_MEMORY` and
1339 `git_cred_ssh_key_memory_new()` have been added.
1340
1341 * `git_filter_list_contains` will indicate whether a particular
1342 filter will be run in the given filter list.
1343
1344 * `git_commit_header_field()` has been added, which allows retrieving
1345 the contents of an arbitrary header field.
1346
1347 * `git_submodule_set_branch()` allows to set the configured branch for
1348 a submodule.
1349
1350 ### API removals
1351
1352 * `git_remote_save()` and `git_remote_clear_refspecs()` have been
1353 removed. Remote's configuration is changed via the configuration
1354 directly or through a convenience function which performs changes to
1355 the configuration directly.
1356
1357 * `git_remote_set_callbacks()`, `git_remote_get_callbacks()` and
1358 `git_remote_set_transport()` have been removed and the remote no
1359 longer stores this configuration.
1360
1361 * `git_remote_set_fetch_refpecs()` and
1362 `git_remote_set_push_refspecs()` have been removed. There is no
1363 longer a way to set the base refspecs at run-time.
1364
1365 * `git_submodule_save()` has been removed. The submodules are no
1366 longer configured via the objects.
1367
1368 * `git_submodule_reload_all()` has been removed as we no longer cache
1369 submodules.
1370
1371 ### Breaking API changes
1372
1373 * `git_smart_subtransport_cb` now has a `param` parameter.
1374
1375 * The `git_merge_options` structure member `flags` has been renamed
1376 to `tree_flags`.
1377
1378 * The `git_merge_file_options` structure member `flags` is now
1379 an unsigned int. It was previously a `git_merge_file_flags_t`.
1380
1381 * `GIT_CHECKOUT_SAFE_CREATE` has been removed. Most users will generally
1382 be able to switch to `GIT_CHECKOUT_SAFE`, but if you require missing
1383 file handling during checkout, you may now use `GIT_CHECKOUT_SAFE |
1384 GIT_CHECKOUT_RECREATE_MISSING`.
1385
1386 * The `git_clone_options` and `git_submodule_update_options`
1387 structures no longer have a `signature` field.
1388
1389 * The following functions have removed the signature and/or log message
1390 parameters in favour of git-emulating ones.
1391
1392 * `git_branch_create()`, `git_branch_move()`
1393 * `git_rebase_init()`, `git_rebase_abort()`
1394 * `git_reference_symbolic_create_matching()`,
1395 `git_reference_symbolic_create()`, `git_reference_create()`,
1396 `git_reference_create_matching()`,
1397 `git_reference_symbolic_set_target()`,
1398 `git_reference_set_target()`, `git_reference_rename()`
1399 * `git_remote_update_tips()`, `git_remote_fetch()`, `git_remote_push()`
1400 * `git_repository_set_head()`,
1401 `git_repository_set_head_detached()`,
1402 `git_repository_detach_head()`
1403 * `git_reset()`
1404
1405 * `git_config_get_entry()` now gives back a ref-counted
1406 `git_config_entry`. You must free it when you no longer need it.
1407
1408 * `git_config_get_string()` will return an error if used on a
1409 non-snapshot configuration, as there can be no guarantee that the
1410 returned pointer is valid.
1411
1412 * `git_note_default_ref()` now uses a `git_buf` to return the string,
1413 as the string is otherwise not guaranteed to stay allocated.
1414
1415 * `git_rebase_operation_current()` will return `GIT_REBASE_NO_OPERATION`
1416 if it is called immediately after creating a rebase session but before
1417 you have applied the first patch.
1418
1419 * `git_rebase_options` now contains a `git_checkout_options` struct
1420 that will be used for functions that modify the working directory,
1421 namely `git_rebase_init`, `git_rebase_next` and
1422 `git_rebase_abort`. As a result, `git_rebase_open` now also takes
1423 a `git_rebase_options` and only the `git_rebase_init` and
1424 `git_rebase_open` functions take a `git_rebase_options`, where they
1425 will persist the options to subsequent `git_rebase` calls.
1426
1427 * The `git_clone_options` struct now has fetch options in a
1428 `fetch_opts` field instead of remote callbacks in
1429 `remote_callbacks`.
1430
1431 * The remote callbacks has gained a new member `push_negotiation`
1432 which gets called before sending the update commands to the server.
1433
1434 * The following functions no longer act on a remote instance but
1435 change the repository's configuration. Their signatures have changed
1436 accordingly:
1437
1438 * `git_remote_set_url()`, `git_remote_seturl()`
1439 * `git_remote_add_fetch()`, `git_remote_add_push()` and
1440 * `git_remote_set_autotag()`
1441
1442 * `git_remote_connect()` and `git_remote_prune()` now take a pointer
1443 to the callbacks.
1444
1445 * `git_remote_fetch()` and `git_remote_download()` now take a pointer
1446 to fetch options which determine the runtime configuration.
1447
1448 * The `git_remote_autotag_option_t` values have been changed. It has
1449 gained a `_UNSPECIFIED` default value to specify no override for the
1450 configured setting.
1451
1452 * `git_remote_update_tips()` now takes a pointer to the callbacks as
1453 well as a boolean whether to write `FETCH_HEAD` and the autotag
1454 setting.
1455
1456 * `git_remote_create_anonymous()` no longer takes a fetch refspec as
1457 url-only remotes cannot have configured refspecs.
1458
1459 * The `git_submodule_update_options` struct now has fetch options in
1460 the `fetch_opts` field instead of callbacks in the
1461 `remote_callbacks` field.
1462
1463 * The following functions no longer act on a submodule instance but
1464 change the repository's configuration. Their signatures have changed
1465 accordingly:
1466
1467 * `git_submodule_set_url()`, `git_submodule_set_ignore()`,
1468 `git_submodule_set_update()`,
1469 `git_submodule_set_fetch_recurse_submodules()`.
1470
1471 * `git_submodule_status()` no longer takes a submodule instance but a
1472 repsitory, a submodule name and an ignore setting.
1473
1474 * The `push` function in the `git_transport` interface now takes a
1475 pointer to the remote callbacks.
1476
1477 * The `git_index_entry` struct's fields' types have been changed to
1478 more accurately reflect what is in fact stored in the
1479 index. Specifically, time and file size are 32 bits intead of 64, as
1480 these values are truncated.
1481
1482 * `GIT_EMERGECONFLICT` is now `GIT_ECONFLICT`, which more accurately
1483 describes the nature of the error.
1484
1485 * It is no longer allowed to call `git_buf_grow()` on buffers
1486 borrowing the memory they point to.
1487
1488 v0.22
1489 ------
1490
1491 ### Changes or improvements
1492
1493 * `git_signature_new()` now requires a non-empty email address.
1494
1495 * Use CommonCrypto libraries for SHA-1 calculation on Mac OS X.
1496
1497 * Disable SSL compression and SSLv2 and SSLv3 ciphers in favor of TLSv1
1498 in OpenSSL.
1499
1500 * The fetch behavior of remotes with autotag set to `GIT_REMOTE_DOWNLOAD_TAGS_ALL`
1501 has been changed to match git 1.9.0 and later. In this mode, libgit2 now
1502 fetches all tags in addition to whatever else needs to be fetched.
1503
1504 * `git_checkout()` now handles case-changing renames correctly on
1505 case-insensitive filesystems; for example renaming "readme" to "README".
1506
1507 * The search for libssh2 is now done via pkg-config instead of a
1508 custom search of a few directories.
1509
1510 * Add support for core.protectHFS and core.protectNTFS. Add more
1511 validation for filenames which we write such as references.
1512
1513 * The local transport now generates textual progress output like
1514 git-upload-pack does ("counting objects").
1515
1516 * `git_checkout_index()` can now check out an in-memory index that is not
1517 necessarily the repository's index, so you may check out an index
1518 that was produced by git_merge and friends while retaining the cached
1519 information.
1520
1521 * Remove the default timeout for receiving / sending data over HTTP using
1522 the WinHTTP transport layer.
1523
1524 * Add SPNEGO (Kerberos) authentication using GSSAPI on Unix systems.
1525
1526 * Provide built-in objects for the empty blob (e69de29) and empty
1527 tree (4b825dc) objects.
1528
1529 * The index' tree cache is now filled upon read-tree and write-tree
1530 and the cache is written to disk.
1531
1532 * LF -> CRLF filter refuses to handle mixed-EOL files
1533
1534 * LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)
1535
1536 * File unlocks are atomic again via rename. Read-only files on Windows are
1537 made read-write if necessary.
1538
1539 * Share open packfiles across repositories to share descriptors and mmaps.
1540
1541 * Use a map for the treebuilder, making insertion O(1)
1542
1543 * The build system now accepts an option EMBED_SSH_PATH which when set
1544 tells it to include a copy of libssh2 at the given location. This is
1545 enabled for MSVC.
1546
1547 * Add support for refspecs with the asterisk in the middle of a
1548 pattern.
1549
1550 * Fetching now performs opportunistic updates. To achieve this, we
1551 introduce a difference between active and passive refspecs, which
1552 make `git_remote_download()` and `git_remote_fetch()` to take a list of
1553 resfpecs to be the active list, similarly to how git fetch accepts a
1554 list on the command-line.
1555
1556 * The THREADSAFE option to build libgit2 with threading support has
1557 been flipped to be on by default.
1558
1559 * The remote object has learnt to prune remote-tracking branches. If
1560 the remote is configured to do so, this will happen via
1561 `git_remote_fetch()`. You can also call `git_remote_prune()` after
1562 connecting or fetching to perform the prune.
1563
1564
1565 ### API additions
1566
1567 * Introduce `git_buf_text_is_binary()` and `git_buf_text_contains_nul()` for
1568 consumers to perform binary detection on a git_buf.
1569
1570 * `git_branch_upstream_remote()` has been introduced to provide the
1571 branch.<name>.remote configuration value.
1572
1573 * Introduce `git_describe_commit()` and `git_describe_workdir()` to provide
1574 a description of the current commit (and working tree, respectively)
1575 based on the nearest tag or reference
1576
1577 * Introduce `git_merge_bases()` and the `git_oidarray` type to expose all
1578 merge bases between two commits.
1579
1580 * Introduce `git_merge_bases_many()` to expose all merge bases between
1581 multiple commits.
1582
1583 * Introduce rebase functionality (using the merge algorithm only).
1584 Introduce `git_rebase_init()` to begin a new rebase session,
1585 `git_rebase_open()` to open an in-progress rebase session,
1586 `git_rebase_commit()` to commit the current rebase operation,
1587 `git_rebase_next()` to apply the next rebase operation,
1588 `git_rebase_abort()` to abort an in-progress rebase and `git_rebase_finish()`
1589 to complete a rebase operation.
1590
1591 * Introduce `git_note_author()` and `git_note_committer()` to get the author
1592 and committer information on a `git_note`, respectively.
1593
1594 * A factory function for ssh has been added which allows to change the
1595 path of the programs to execute for receive-pack and upload-pack on
1596 the server, `git_transport_ssh_with_paths()`.
1597
1598 * The ssh transport supports asking the remote host for accepted
1599 credential types as well as multiple challeges using a single
1600 connection. This requires to know which username you want to connect
1601 as, so this introduces the USERNAME credential type which the ssh
1602 transport will use to ask for the username.
1603
1604 * The `GIT_EPEEL` error code has been introduced when we cannot peel a tag
1605 to the requested object type; if the given object otherwise cannot be
1606 peeled, `GIT_EINVALIDSPEC` is returned.
1607
1608 * Introduce `GIT_REPOSITORY_INIT_RELATIVE_GITLINK` to use relative paths
1609 when writing gitlinks, as is used by git core for submodules.
1610
1611 * `git_remote_prune()` has been added. See above for description.
1612
1613
1614 * Introduce reference transactions, which allow multiple references to
1615 be locked at the same time and updates be queued. This also allows
1616 us to safely update a reflog with arbitrary contents, as we need to
1617 do for stash.
1618
1619 ### API removals
1620
1621 * `git_remote_supported_url()` and `git_remote_is_valid_url()` have been
1622 removed as they have become essentially useless with rsync-style ssh paths.
1623
1624 * `git_clone_into()` and `git_clone_local_into()` have been removed from the
1625 public API in favour of `git_clone callbacks`.
1626
1627 * The option to ignore certificate errors via `git_remote_cert_check()`
1628 is no longer present. Instead, `git_remote_callbacks` has gained a new
1629 entry which lets the user perform their own certificate checks.
1630
1631 ### Breaking API changes
1632
1633 * `git_cherry_pick()` is now `git_cherrypick()`.
1634
1635 * The `git_submodule_update()` function was renamed to
1636 `git_submodule_update_strategy()`. `git_submodule_update()` is now used to
1637 provide functionalty similar to "git submodule update".
1638
1639 * `git_treebuilder_create()` was renamed to `git_treebuilder_new()` to better
1640 reflect it being a constructor rather than something which writes to
1641 disk.
1642
1643 * `git_treebuilder_new()` (was `git_treebuilder_create()`) now takes a
1644 repository so that it can query repository configuration.
1645 Subsequently, `git_treebuilder_write()` no longer takes a repository.
1646
1647 * `git_threads_init()` and `git_threads_shutdown()` have been renamed to
1648 `git_libgit2_init()` and `git_libgit2_shutdown()` to better explain what
1649 their purpose is, as it's grown to be more than just about threads.
1650
1651 * `git_libgit2_init()` and `git_libgit2_shutdown()` now return the number of
1652 initializations of the library, so consumers may schedule work on the
1653 first initialization.
1654
1655 * The `git_transport_register()` function no longer takes a priority and takes
1656 a URL scheme name (eg "http") instead of a prefix like "http://"
1657
1658 * `git_index_name_entrycount()` and `git_index_reuc_entrycount()` now
1659 return size_t instead of unsigned int.
1660
1661 * The `context_lines` and `interhunk_lines` fields in `git_diff`_options are
1662 now `uint32_t` instead of `uint16_t`. This allows to set them to `UINT_MAX`,
1663 in effect asking for "infinite" context e.g. to iterate over all the
1664 unmodified lines of a diff.
1665
1666 * `git_status_file()` now takes an exact path. Use `git_status_list_new()` if
1667 pathspec searching is needed.
1668
1669 * `git_note_create()` has changed the position of the notes reference
1670 name to match `git_note_remove()`.
1671
1672 * Rename `git_remote_load()` to `git_remote_lookup()` to bring it in line
1673 with the rest of the lookup functions.
1674
1675 * `git_remote_rename()` now takes the repository and the remote's
1676 current name. Accepting a remote indicates we want to change it,
1677 which we only did partially. It is much clearer if we accept a name
1678 and no loaded objects are changed.
1679
1680 * `git_remote_delete()` now accepts the repository and the remote's name
1681 instead of a loaded remote.
1682
1683 * `git_merge_head` is now `git_annotated_commit`, to better reflect its usage
1684 for multiple functions (including rebase)
1685
1686 * The `git_clone_options` struct no longer provides the `ignore_cert_errors` or
1687 `remote_name` members for remote customization.
1688
1689 Instead, the `git_clone_options` struct has two new members, `remote_cb` and
1690 `remote_cb_payload`, which allow the caller to completely override the remote
1691 creation process. If needed, the caller can use this callback to give their
1692 remote a name other than the default (origin) or disable cert checking.
1693
1694 The `remote_callbacks` member has been preserved for convenience, although it
1695 is not used when a remote creation callback is supplied.
1696
1697 * The `git_clone`_options struct now provides `repository_cb` and
1698 `repository_cb_payload` to allow the user to create a repository with
1699 custom options.
1700
1701 * The `git_push` struct to perform a push has been replaced with
1702 `git_remote_upload()`. The refspecs and options are passed as a
1703 function argument. `git_push_update_tips()` is now also
1704 `git_remote_update_tips()` and the callbacks are in the same struct as
1705 the rest.
1706
1707 * The `git_remote_set_transport()` function now sets a transport factory function,
1708 rather than a pre-existing transport instance.
1709
1710 * The `git_transport` structure definition has moved into the sys/transport.h
1711 file.
1712
1713 * libgit2 no longer automatically sets the OpenSSL locking
1714 functions. This is not something which we can know to do. A
1715 last-resort convenience function is provided in sys/openssl.h,
1716 `git_openssl_set_locking()` which can be used to set the locking.