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