]> git.proxmox.com Git - libgit2.git/blame - CHANGELOG.md
Merge pull request #4254 from pks-t/pks/changelog-v0.26
[libgit2.git] / CHANGELOG.md
CommitLineData
5569778a
CMN
1v0.25 + 1
2-------
3
4### Changes or improvements
5
a1510880
PS
6* Support for opening, creating and modifying worktrees.
7
8* We can now detect SHA1 collisions resulting from the SHAttered attack. These
9 checks can be enabled at build time via `-DUSE_SHA1DC`.
10
11* Fix for missing implementation of `git_merge_driver_source` getters.
12
13* Fix for installed pkg-config file being broken when the prefix contains
14 spaces.
15
16* We now detect when the hashsum of on-disk objects does not match their
17 expected hashsum.
18
19* We now support open-ended ranges (e.g. "master..", "...master") in our
20 revision range parsing code.
21
22* We now correctly compute ignores with leading "/" in subdirectories.
23
24* We now optionally call `fsync` on loose objects, packfiles and their indexes,
25 loose references and packed reference files.
26
27* We can now build against OpenSSL v1.1.
28
07bb8078
ET
29* `GIT_MERGE_OPTIONS_INIT` now includes a setting to perform rename detection.
30 This aligns this structure with the default by `git_merge` and
31 `git_merge_trees` when `NULL` was provided for the options.
32
5569778a
CMN
33### API additions
34
a1510880
PS
35* New family of functions to handle worktrees:
36
37 * `git_worktree_list()` lets you look up worktrees for a repository.
38 * `git_worktree_lookup()` lets you get a specific worktree.
39 * `git_worktree_open_from_repository()` lets you get the associated worktree
40 of a repository.
41 a worktree.
42 * `git_worktree_add` lets you create new worktrees.
43 * `git_worktree_prune` lets you remove worktrees from disk.
44 * `git_worktree_lock()` and `git_worktree_unlock()` let you lock
45 respectively unlock a worktree.
46 * `git_repository_open_from_worktree()` lets you open a repository via
47 * `git_repository_head_for_worktree()` lets you get the current `HEAD` for a
48 linked worktree.
49 * `git_repository_head_detached_for_worktree()` lets you check whether a
50 linked worktree is in detached HEAD mode.
51
52* `git_repository_item_path()` lets you retrieve paths for various repository
53 files.
54
55* `git_repository_commondir()` lets you retrieve the common directory of a
56 repository.
57
58* `git_branch_is_checked_out()` allows you to check whether a branch is checked
59 out in a repository or any of its worktrees.
60
61* `git_repository_submodule_cache_all()` and
62 `git_repository_submodule_cache_clear()` functions allow you to prime or clear
63 the submodule cache of a repository.
64
65* You can disable strict hash verifications via the
66 `GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION` option with `git_libgit2_opts()`.
67
68* You can enable us calling `fsync` for various files inside the ".git"
69 directory by setting the `GIT_OPT_ENABLE_FSYNC_GITDIR` option with
70 `git_libgit2_opts()`.
71
72* You can now enable "offset deltas" when creating packfiles and negotiating
73 packfiles with a remote server by setting `GIT_OPT_ENABLE_OFS_DELTA` option
74 with `GIT_libgit2_opts()`.
75
d5e6ca1e
SS
76* You can now set the default share mode on Windows for opening files using
77 `GIT_OPT_SET_WINDOWS_SHAREMODE` option with `git_libgit2_opts()`.
78 You can query the current share mode with `GIT_OPT_GET_WINDOWS_SHAREMODE`.
79
a1510880
PS
80* `git_transport_smart_proxy_options()' enables you to get the proxy options for
81 smart transports.
82
5569778a
CMN
83### API removals
84
85### Breaking API changes
86
3b4eb107
ET
87* `clone_checkout_strategy` has been removed from
88 `git_submodule_update_option`. The checkout strategy used to clone will
89 be the same strategy specified in `checkout_opts`.
90
5569778a 91v0.25
c21c8f67
CMN
92-------
93
94### Changes or improvements
95
04d6ab6c
JT
96* Fix repository discovery with `git_repository_discover` and
97 `git_repository_open_ext` to match git's handling of a ceiling
98 directory at the current directory. git only checks ceiling
99 directories when its search ascends to a parent directory. A ceiling
100 directory matching the starting directory will not prevent git from
101 finding a repository in the starting directory or a parent directory.
102
d81cb2e4
DT
103* Do not fail when deleting remotes in the presence of broken
104 global configs which contain branches.
105
5625d86b
DT
106* Support for reading and writing git index v4 files
107
4aed1b9a
CMN
108* Improve the performance of the revwalk and bring us closer to git's code.
109
06de4e75
CMN
110* The reference db has improved support for concurrency and returns `GIT_ELOCKED`
111 when an operation could not be performed due to locking.
112
113* Nanosecond resolution is now activated by default, following git's change to
114 do this.
115
116* We now restrict the set of ciphers we let OpenSSL use by default.
117
118* Users can now register their own merge drivers for use with `.gitattributes`.
119 The library also gained built-in support for the union merge driver.
120
121* The default for creating references is now to validate that the object does
122 exist.
123
124* Add `git_proxy_options` which is used by the different networking
125 implementations to let the caller specify the proxy settings instead of
126 relying on the environment variables.
127
c21c8f67
CMN
128### API additions
129
f1dba144
AB
130* You can now get the user-agent used by libgit2 using the
131 `GIT_OPT_GET_USER_AGENT` option with `git_libgit2_opts()`.
132 It is the counterpart to `GIT_OPT_SET_USER_AGENT`.
133
06de4e75
CMN
134* The `GIT_OPT_SET_SSL_CIPHERS` option for `git_libgit2_opts()` lets you specify
135 a custom list of ciphers to use for OpenSSL.
136
47cb42da 137* `git_commit_create_buffer()` creates a commit and writes it into a
06de4e75
CMN
138 user-provided buffer instead of writing it into the object db. Combine it with
139 `git_commit_create_with_signature()` in order to create a commit with a
140 cryptographic signature.
47cb42da 141
e2bb9ed3
CMN
142* `git_blob_create_fromstream()` and
143 `git_blob_create_fromstream_commit()` allow you to create a blob by
144 writing into a stream. Useful when you do not know the final size or
145 want to copy the contents from another stream.
146
2b80260e
JT
147* New flags for `git_repository_open_ext`:
148
149 * `GIT_REPOSITORY_OPEN_NO_DOTGIT` - Do not check for a repository by
150 appending `/.git` to the `start_path`; only open the repository if
151 `start_path` itself points to the git directory.
152 * `GIT_REPOSITORY_OPEN_FROM_ENV` - Find and open a git repository,
153 respecting the environment variables used by the git command-line
154 tools. If set, `git_repository_open_ext` will ignore the other
155 flags and the `ceiling_dirs` argument, and will allow a NULL
156 `path` to use `GIT_DIR` or search from the current directory. The
157 search for a repository will respect `$GIT_CEILING_DIRECTORIES`
158 and `$GIT_DISCOVERY_ACROSS_FILESYSTEM`. The opened repository
159 will respect `$GIT_INDEX_FILE`, `$GIT_NAMESPACE`,
160 `$GIT_OBJECT_DIRECTORY`, and `$GIT_ALTERNATE_OBJECT_DIRECTORIES`.
161 In the future, this flag will also cause `git_repository_open_ext`
162 to respect `$GIT_WORK_TREE` and `$GIT_COMMON_DIR`; currently,
163 `git_repository_open_ext` with this flag will error out if either
164 `$GIT_WORK_TREE` or `$GIT_COMMON_DIR` is set.
165
06de4e75 166* `git_diff_from_buffer()` can create a `git_diff` object from the contents
e2e7f31a
ET
167 of a git-style patch file.
168
5625d86b
DT
169* `git_index_version()` and `git_index_set_version()` to get and set
170 the index version
171
06de4e75
CMN
172* `git_odb_expand_ids()` lets you check for the existence of multiple
173 objects at once.
174
175* The new `git_blob_dup()`, `git_commit_dup()`, `git_tag_dup()` and
176 `git_tree_dup()` functions provide type-specific wrappers for
177 `git_object_dup()` to reduce noise and increase type safety for callers.
178
179* `git_reference_dup()` lets you duplicate a reference to aid in ownership
180 management and cleanup.
181
182* `git_signature_from_buffer()` lets you create a signature from a string in the
183 format that appear in objects.
184
185* `git_tree_create_updated()` lets you create a tree based on another one
186 together with a list of updates. For the covered update cases, it's more
187 efficient than the `git_index` route.
188
189* `git_apply_patch()` applies hunks from a `git_patch` to a buffer.
190
191* `git_diff_to_buf()` lets you print an entire diff directory to a buffer,
192 similar to how `git_patch_to_buf()` works.
193
194* `git_proxy_init_options()` is added to initialize a `git_proxy_options`
195 structure at run-time.
196
197* `git_merge_driver_register()`, `git_merge_driver_unregister()` let you
198 register and unregister a custom merge driver to be used when `.gitattributes`
199 specifies it.
200
201* `git_merge_driver_lookup()` can be used to look up a merge driver by name.
202
203* `git_merge_driver_source_repo()`, `git_merge_driver_source_ancestor()`,
204 `git_merge_driver_source_ours()`, `git_merge_driver_source_theirs()`,
205 `git_merge_driver_source_file_options()` added as accessors to
206 `git_merge_driver_source`.
207
c21c8f67
CMN
208### API removals
209
6669e3e8
CMN
210* `git_blob_create_fromchunks()` has been removed in favour of
211 `git_blob_create_fromstream()`.
212
c21c8f67
CMN
213### Breaking API changes
214
60e15ecd
ET
215* `git_packbuilder_object_count` and `git_packbuilder_written` now
216 return a `size_t` instead of a `uint32_t` for more thorough
217 compatibility with the rest of the library.
218
219* `git_packbuiler_progress` now provides explicitly sized `uint32_t`
220 values instead of `unsigned int`.
221
002c8e29
ET
222* `git_diff_file` now includes an `id_abbrev` field that reflects the
223 number of nibbles set in the `id` field.
224
8f09a98e
ET
225* `git_odb_backend` now has a `freshen` function pointer. This optional
226 function pointer is similar to the `exists` function, but it will update
227 a last-used marker. For filesystem-based object databases, this updates
228 the timestamp of the file containing the object, to indicate "freshness".
229 If this is `NULL`, then it will not be called and the `exists` function
230 will be used instead.
231
31c78299
SB
232* `git_remote_connect()` now accepts `git_proxy_options` argument, and
233 `git_fetch_options` and `git_push_options` each have a `proxy_opts` field.
06de4e75 234
d8f984bc
SB
235* `git_merge_options` now provides a `default_driver` that can be used
236 to provide the name of a merge driver to be used to handle files changed
237 during a merge.
238
c21c8f67 239v0.24
159061a8
CMN
240-------
241
242### Changes or improvements
243
30a94ab7
ET
244* Custom merge drivers can now be registered, which allows callers to
245 configure callbacks to honor `merge=driver` configuration in
246 `.gitattributes`.
247
9a99ca7b
ET
248* Custom filters can now be registered with wildcard attributes, for
249 example `filter=*`. Consumers should examine the attributes parameter
250 of the `check` function for details.
251
d83b2e9f
CMN
252* Symlinks are now followed when locking a file, which can be
253 necessary when multiple worktrees share a base repository.
254
027bbaa7
CMN
255* You can now set your own user-agent to be sent for HTTP requests by
256 using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`.
257
82885255
CMN
258* You can set custom HTTP header fields to be sent along with requests
259 by passing them in the fetch and push options.
260
fc436469
CMN
261* Tree objects are now assumed to be sorted. If a tree is not
262 correctly formed, it will give bad results. This is the git approach
263 and cuts a significant amount of time when reading the trees.
264
f596946f
CMN
265* Filter registration is now protected against concurrent
266 registration.
267
268* Filenames which are not valid on Windows in an index no longer cause
269 to fail to parse it on that OS.
270
271* Rebases can now be performed purely in-memory, without touching the
272 repository's workdir.
273
f2dddf52
ET
274* When adding objects to the index, or when creating new tree or commit
275 objects, the inputs are validated to ensure that the dependent objects
276 exist and are of the correct type. This object validation can be
277 disabled with the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION option.
278
a7ef27af
CMN
279* The WinHTTP transport's handling of bad credentials now behaves like
280 the others, asking for credentials again.
281
159061a8
CMN
282### API additions
283
5340d63d
CMN
284* `git_config_lock()` has been added, which allow for
285 transactional/atomic complex updates to the configuration, removing
286 the opportunity for concurrent operations and not committing any
287 changes until the unlock.
36f784b5 288
3138ad93
JH
289* `git_diff_options` added a new callback `progress_cb` to report on the
290 progress of the diff as files are being compared. The documentation of
291 the existing callback `notify_cb` was updated to reflect that it only
292 gets called when new deltas are added to the diff.
293
82885255
CMN
294* `git_fetch_options` and `git_push_options` have gained a `custom_headers`
295 field to set the extra HTTP header fields to send.
296
7fafde63
CMN
297* `git_stream_register_tls()` lets you register a callback to be used
298 as the constructor for a TLS stream instead of the libgit2 built-in
299 one.
300
f596946f
CMN
301* `git_commit_header_field()` allows you to look up a specific header
302 field in a commit.
303
304* `git_commit_extract_signature()` extracts the signature from a
305 commit and gives you both the signature and the signed data so you
306 can verify it.
307
159061a8
CMN
308### API removals
309
c21c8f67
CMN
310* No APIs were removed in this version.
311
79698030
ET
312### Breaking API changes
313
fa78782f
ET
314* The `git_merge_tree_flag_t` is now `git_merge_flag_t`. Subsequently,
315 its members are no longer prefixed with `GIT_MERGE_TREE_FLAG` but are
316 now prefixed with `GIT_MERGE_FLAG`, and the `tree_flags` field of the
317 `git_merge_options` structure is now named `flags`.
318
319* The `git_merge_file_flags_t` enum is now `git_merge_file_flag_t` for
320 consistency with other enum type names.
321
79698030
ET
322* `git_cert` descendent types now have a proper `parent` member
323
fec4a68c 324* It is the responsibility of the refdb backend to decide what to do
01d0c02d
CMN
325 with the reflog on ref deletion. The file-based backend must delete
326 it, a database-backed one may wish to archive it.
327
36f784b5
CMN
328* `git_config_backend` has gained two entries. `lock` and `unlock`
329 with which to implement the transactional/atomic semantics for the
330 configuration backend.
331
ad8509ef
CMN
332* `git_index_add` and `git_index_conflict_add()` will now use the case
333 as provided by the caller on case insensitive systems. Previous
334 versions would keep the case as it existed in the index. This does
335 not affect the higher-level `git_index_add_bypath` or
336 `git_index_add_frombuffer` functions.
a32bc85e 337
3138ad93
JH
338* The `notify_payload` field of `git_diff_options` was renamed to `payload`
339 to reflect that it's also the payload for the new progress callback.
340
82885255
CMN
341* The `git_config_level_t` enum has gained a higher-priority value
342 `GIT_CONFIG_LEVEL_PROGRAMDATA` which represent a rough Windows equivalent
343 to the system level configuration.
344
0b24855e 345* `git_rebase_options` now has a `merge_options` field.
f596946f
CMN
346
347* The index no longer performs locking itself. This is not something
348 users of the library should have been relying on as it's not part of
349 the concurrency guarantees.
350
0b24855e
JF
351* `git_remote_connect()` now takes a `custom_headers` argument to set
352 the extra HTTP header fields to send.
353
159061a8 354v0.23
c8b64f70
CMN
355------
356
16bcf0c7
CMN
357### Changes or improvements
358
70b0f128
JG
359* Patience and minimal diff drivers can now be used for merges.
360
361* Merges can now ignore whitespace changes.
362
0161e096
SS
363* Updated binary identification in CRLF filtering to avoid false positives in
364 UTF-8 files.
365
4d6f55ac
ET
366* Rename and copy detection is enabled for small files.
367
96b82b11
ET
368* Checkout can now handle an initial checkout of a repository, making
369 `GIT_CHECKOUT_SAFE_CREATE` unnecessary for users of clone.
370
659cf202
CMN
371* The signature parameter in the ref-modifying functions has been
372 removed. Use `git_repository_set_ident()` and
373 `git_repository_ident()` to override the signature to be used.
374
0ef54a63
CMN
375* The local transport now auto-scales the number of threads to use
376 when creating the packfile instead of sticking to one.
377
8acf058f
CMN
378* Reference renaming now uses the right id for the old value.
379
380* The annotated version of branch creation, HEAD detaching and reset
381 allow for specifying the expression from the user to be put into the
382 reflog.
383
aa9bb425 384* `git_rebase_commit` now returns `GIT_EUNMERGED` when you attempt to
eaf0d688
ET
385 commit with unstaged changes.
386
85247df0 387* On Mac OS X, we now use SecureTransport to provide the cryptographic
ca2466ff 388 support for HTTPS connections insead of OpenSSL.
85247df0 389
1f1f5c63
ET
390* Checkout can now accept an index for the baseline computations via the
391 `baseline_index` member.
392
b1ae3e53
CMN
393* The configuration for fetching is no longer stored inside the
394 `git_remote` struct but has been moved to a `git_fetch_options`. The
395 remote functions now take these options or the callbacks instead of
396 setting them beforehand.
397
ca2466ff
CMN
398* `git_submodule` instances are no longer cached or shared across
399 lookup. Each submodule represents the configuration at the time of
400 loading.
401
874cc35a
CMN
402* The index now uses diffs for `add_all()` and `update_all()` which
403 gives it a speed boost and closer semantics to git.
404
e3435673
CMN
405* The ssh transport now reports the stderr output from the server as
406 the error message, which allows you to get the "repository not
407 found" messages.
408
ecd60a56
ET
409* `git_index_conflict_add()` will remove staged entries that exist for
410 conflicted paths.
b1ae3e53 411
10549a2d
ET
412* The flags for a `git_diff_file` will now have the `GIT_DIFF_FLAG_EXISTS`
413 bit set when a file exists on that side of the diff. This is useful
414 for understanding whether a side of the diff exists in the presence of
415 a conflict.
b1ae3e53 416
a5670d4f
CMN
417* The constructor for a write-stream into the odb now takes
418 `git_off_t` instead of `size_t` for the size of the blob, which
419 allows putting large files into the odb on 32-bit systems.
420
771069e1
PS
421* The remote's push and pull URLs now honor the url.$URL.insteadOf
422 configuration. This allows modifying URL prefixes to a custom
423 value via gitconfig.
424
0e522f6e
ET
425* `git_diff_foreach`, `git_diff_blobs`, `git_diff_blob_to_buffer`,
426 and `git_diff_buffers` now accept a new binary callback of type
427 `git_diff_binary_cb` that includes the binary diff information.
428
bb4896f2
CMN
429* The race condition mitigations described in `racy-git.txt` have been
430 implemented.
431
ede517bc
CMN
432* If libcurl is installed, we will use it to connect to HTTP(S)
433 servers.
434
16bcf0c7
CMN
435### API additions
436
70b0f128
JG
437* The `git_merge_options` gained a `file_flags` member.
438
eac773d9
CMN
439* Parsing and retrieving a configuration value as a path is exposed
440 via `git_config_parse_path()` and `git_config_get_path()`
441 respectively.
442
659cf202
CMN
443* `git_repository_set_ident()` and `git_repository_ident()` serve to
444 set and query which identity will be used when writing to the
445 reflog.
446
9a97f49e
CMN
447* `git_config_entry_free()` frees a config entry.
448
449* `git_config_get_string_buf()` provides a way to safely retrieve a
450 string from a non-snapshot configuration.
451
8acf058f
CMN
452* `git_annotated_commit_from_revspec()` allows to get an annotated
453 commit from an extended sha synatx string.
454
455* `git_repository_set_head_detached_from_annotated()`,
456 `git_branch_create_from_annotated()` and
457 `git_reset_from_annotated()` allow for the caller to provide an
458 annotated commit through which they can control what expression is
459 put into the reflog as the source/target.
d578b45f 460
a275fbc0 461* `git_index_add_frombuffer()` can now create a blob from memory
b1ae3e53
CMN
462 buffer and add it to the index which is attached to a repository.
463
464* The structure `git_fetch_options` has been added to determine the
465 runtime configuration for fetching, such as callbacks, pruning and
466 autotag behaviour. It has the runtime initializer
467 `git_fetch_init_options()`.
468
469* The enum `git_fetch_prune_t` has been added, letting you specify the
470 pruning behaviour for a fetch.
a275fbc0 471
a5670d4f
CMN
472* A push operation will notify the caller of what updates it indends
473 to perform on the remote, which provides similar information to
474 git's pre-push hook.
475
15fdf054
ET
476* `git_stash_apply()` can now apply a stashed state from the stash list,
477 placing the data into the working directory and index.
478
479* `git_stash_pop()` will apply a stashed state (like `git_stash_apply()`)
480 but will remove the stashed state after a successful application.
481
1396c381
CMN
482* A new error code `GIT_EEOF` indicates an early EOF from the
483 server. This typically indicates an error with the URL or
484 configuration of the server, and tools can use this to show messages
485 about failing to communicate with the server.
486
3cf91d98
CMN
487* A new error code `GIT_EINVALID` indicates that an argument to a
488 function is invalid, or an invalid operation was requested.
489
7c948014
ET
490* `git_diff_index_to_workdir()` and `git_diff_tree_to_index()` will now
491 produce deltas of type `GIT_DELTA_CONFLICTED` to indicate that the index
492 side of the delta is a conflict.
493
494* The `git_status` family of functions will now produce status of type
495 `GIT_STATUS_CONFLICTED` to indicate that a conflict exists for that file
496 in the index.
497
9f545b9d
ET
498* `git_index_entry_is_conflict()` is a utility function to determine if
499 a given index entry has a non-zero stage entry, indicating that it is
500 one side of a conflict.
501
a5670d4f
CMN
502* It is now possible to pass a keypair via a buffer instead of a
503 path. For this, `GIT_CREDTYPE_SSH_MEMORY` and
504 `git_cred_ssh_key_memory_new()` have been added.
505
2eecc288
ET
506* `git_filter_list_contains` will indicate whether a particular
507 filter will be run in the given filter list.
508
a3f42fe8
CMN
509* `git_commit_header_field()` has been added, which allows retrieving
510 the contents of an arbitrary header field.
511
ca2466ff
CMN
512* `git_submodule_set_branch()` allows to set the configured branch for
513 a submodule.
514
16bcf0c7
CMN
515### API removals
516
9663d1bd 517* `git_remote_save()` and `git_remote_clear_refspecs()` have been
b1ae3e53
CMN
518 removed. Remote's configuration is changed via the configuration
519 directly or through a convenience function which performs changes to
520 the configuration directly.
521
522* `git_remote_set_callbacks()`, `git_remote_get_callbacks()` and
9663d1bd 523 `git_remote_set_transport()` have been removed and the remote no
b1ae3e53
CMN
524 longer stores this configuration.
525
70f7484d
CMN
526* `git_remote_set_fetch_refpecs()` and
527 `git_remote_set_push_refspecs()` have been removed. There is no
528 longer a way to set the base refspecs at run-time.
529
ca2466ff
CMN
530* `git_submodule_save()` has been removed. The submodules are no
531 longer configured via the objects.
532
34065968
CMN
533* `git_submodule_reload_all()` has been removed as we no longer cache
534 submodules.
535
16bcf0c7
CMN
536### Breaking API changes
537
bf2ba529
JM
538* `git_smart_subtransport_cb` now has a `param` parameter.
539
70b0f128
JG
540* The `git_merge_options` structure member `flags` has been renamed
541 to `tree_flags`.
542
b8c50808 543* The `git_merge_file_options` structure member `flags` is now
70b0f128
JG
544 an unsigned int. It was previously a `git_merge_file_flags_t`.
545
96b82b11
ET
546* `GIT_CHECKOUT_SAFE_CREATE` has been removed. Most users will generally
547 be able to switch to `GIT_CHECKOUT_SAFE`, but if you require missing
548 file handling during checkout, you may now use `GIT_CHECKOUT_SAFE |
549 GIT_CHECKOUT_RECREATE_MISSING`.
550
41513659
CMN
551* The `git_clone_options` and `git_submodule_update_options`
552 structures no longer have a `signature` field.
553
554* The following functions have removed the signature and/or log message
555 parameters in favour of git-emulating ones.
556
557 * `git_branch_create()`, `git_branch_move()`
558 * `git_rebase_init()`, `git_rebase_abort()`
559 * `git_reference_symbolic_create_matching()`,
560 `git_reference_symbolic_create()`, `git_reference_create()`,
561 `git_reference_create_matching()`,
562 `git_reference_symbolic_set_target()`,
563 `git_reference_set_target()`, `git_reference_rename()`
564 * `git_remote_update_tips()`, `git_remote_fetch()`, `git_remote_push()`
565 * `git_repository_set_head()`,
566 `git_repository_set_head_detached()`,
567 `git_repository_detach_head()`
568 * `git_reset()`
569
9a97f49e
CMN
570* `git_config_get_entry()` now gives back a ref-counted
571 `git_config_entry`. You must free it when you no longer need it.
572
573* `git_config_get_string()` will return an error if used on a
574 non-snapshot configuration, as there can be no guarantee that the
575 returned pointer is valid.
576
385449b1
CMN
577* `git_note_default_ref()` now uses a `git_buf` to return the string,
578 as the string is otherwise not guaranteed to stay allocated.
579
30640aa9
ET
580* `git_rebase_operation_current()` will return `GIT_REBASE_NO_OPERATION`
581 if it is called immediately after creating a rebase session but before
582 you have applied the first patch.
583
a5670d4f
CMN
584* `git_rebase_options` now contains a `git_checkout_options` struct
585 that will be used for functions that modify the working directory,
88ab3be6
CMN
586 namely `git_rebase_init`, `git_rebase_next` and
587 `git_rebase_abort`. As a result, `git_rebase_open` now also takes
a5670d4f 588 a `git_rebase_options` and only the `git_rebase_init` and
f3a199dd
ET
589 `git_rebase_open` functions take a `git_rebase_options`, where they
590 will persist the options to subsequent `git_rebase` calls.
591
b1ae3e53
CMN
592* The `git_clone_options` struct now has fetch options in a
593 `fetch_opts` field instead of remote callbacks in
594 `remote_callbacks`.
595
a5670d4f
CMN
596* The remote callbacks has gained a new member `push_negotiation`
597 which gets called before sending the update commands to the server.
598
ca2466ff 599* The following functions no longer act on a remote instance but
b1ae3e53
CMN
600 change the repository's configuration. Their signatures have changed
601 accordingly:
602
603 * `git_remote_set_url()`, `git_remote_seturl()`
604 * `git_remote_add_fetch()`, `git_remote_add_push()` and
605 * `git_remote_set_autotag()`
606
607* `git_remote_connect()` and `git_remote_prune()` now take a pointer
608 to the callbacks.
609
9663d1bd 610* `git_remote_fetch()` and `git_remote_download()` now take a pointer
b1ae3e53
CMN
611 to fetch options which determine the runtime configuration.
612
613* The `git_remote_autotag_option_t` values have been changed. It has
c2418f46 614 gained a `_UNSPECIFIED` default value to specify no override for the
b1ae3e53
CMN
615 configured setting.
616
617* `git_remote_update_tips()` now takes a pointer to the callbacks as
618 well as a boolean whether to write `FETCH_HEAD` and the autotag
619 setting.
620
ae5b9362
CMN
621* `git_remote_create_anonymous()` no longer takes a fetch refspec as
622 url-only remotes cannot have configured refspecs.
623
b1ae3e53
CMN
624* The `git_submodule_update_options` struct now has fetch options in
625 the `fetch_opts` field instead of callbacks in the
626 `remote_callbacks` field.
627
ca2466ff
CMN
628* The following functions no longer act on a submodule instance but
629 change the repository's configuration. Their signatures have changed
630 accordingly:
631
632 * `git_submodule_set_url()`, `git_submodule_set_ignore()`,
633 `git_submodule_set_update()`,
634 `git_submodule_set_fetch_recurse_submodules()`.
635
636* `git_submodule_status()` no longer takes a submodule instance but a
637 repsitory, a submodule name and an ignore setting.
638
b1ae3e53
CMN
639* The `push` function in the `git_transport` interface now takes a
640 pointer to the remote callbacks.
641
98270f56
CMN
642* The `git_index_entry` struct's fields' types have been changed to
643 more accurately reflect what is in fact stored in the
644 index. Specifically, time and file size are 32 bits intead of 64, as
645 these values are truncated.
646
885b94aa
ET
647* `GIT_EMERGECONFLICT` is now `GIT_ECONFLICT`, which more accurately
648 describes the nature of the error.
649
3cf91d98
CMN
650* It is no longer allowed to call `git_buf_grow()` on buffers
651 borrowing the memory they point to.
652
c8b64f70 653v0.22
d30447cb
CMN
654------
655
b91f28be 656### Changes or improvements
e1fc03c9 657
b91f28be 658* `git_signature_new()` now requires a non-empty email address.
274c3fa6 659
b91f28be 660* Use CommonCrypto libraries for SHA-1 calculation on Mac OS X.
d412165f 661
b91f28be
CMN
662* Disable SSL compression and SSLv2 and SSLv3 ciphers in favor of TLSv1
663 in OpenSSL.
d412165f 664
b91f28be
CMN
665* The fetch behavior of remotes with autotag set to `GIT_REMOTE_DOWNLOAD_TAGS_ALL`
666 has been changed to match git 1.9.0 and later. In this mode, libgit2 now
667 fetches all tags in addition to whatever else needs to be fetched.
c180c065 668
b91f28be
CMN
669* `git_checkout()` now handles case-changing renames correctly on
670 case-insensitive filesystems; for example renaming "readme" to "README".
7449c82e 671
b91f28be
CMN
672* The search for libssh2 is now done via pkg-config instead of a
673 custom search of a few directories.
3753110a 674
b91f28be
CMN
675* Add support for core.protectHFS and core.protectNTFS. Add more
676 validation for filenames which we write such as references.
5192bcc5 677
b91f28be
CMN
678* The local transport now generates textual progress output like
679 git-upload-pack does ("counting objects").
c180c065 680
b91f28be
CMN
681* `git_checkout_index()` can now check out an in-memory index that is not
682 necessarily the repository's index, so you may check out an index
683 that was produced by git_merge and friends while retaining the cached
684 information.
1697cd6f 685
b91f28be
CMN
686* Remove the default timeout for receiving / sending data over HTTP using
687 the WinHTTP transport layer.
d4256ed5 688
b91f28be 689* Add SPNEGO (Kerberos) authentication using GSSAPI on Unix systems.
46c8f7f8 690
b91f28be
CMN
691* Provide built-in objects for the empty blob (e69de29) and empty
692 tree (4b825dc) objects.
262eec23 693
b91f28be
CMN
694* The index' tree cache is now filled upon read-tree and write-tree
695 and the cache is written to disk.
0862f617 696
b91f28be 697* LF -> CRLF filter refuses to handle mixed-EOL files
1697cd6f 698
b91f28be 699* LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)
1697cd6f 700
b91f28be
CMN
701* File unlocks are atomic again via rename. Read-only files on Windows are
702 made read-write if necessary.
d58a64e9 703
b91f28be 704* Share open packfiles across repositories to share descriptors and mmaps.
6812afaf 705
b91f28be 706* Use a map for the treebuilder, making insertion O(1)
2cd3cb8e 707
b91f28be
CMN
708* The build system now accepts an option EMBED_SSH_PATH which when set
709 tells it to include a copy of libssh2 at the given location. This is
710 enabled for MSVC.
9fef46de
CMN
711
712* Add support for refspecs with the asterisk in the middle of a
713 pattern.
7db0e6ee 714
c5837cad
CMN
715* Fetching now performs opportunistic updates. To achieve this, we
716 introduce a difference between active and passive refspecs, which
b91f28be 717 make `git_remote_download()` and `git_remote_fetch()` to take a list of
c5837cad
CMN
718 resfpecs to be the active list, similarly to how git fetch accepts a
719 list on the command-line.
720
b91f28be
CMN
721* The THREADSAFE option to build libgit2 with threading support has
722 been flipped to be on by default.
209425ce 723
b91f28be
CMN
724* The remote object has learnt to prune remote-tracking branches. If
725 the remote is configured to do so, this will happen via
726 `git_remote_fetch()`. You can also call `git_remote_prune()` after
727 connecting or fetching to perform the prune.
728
729
730### API additions
d524b2d3 731
b91f28be
CMN
732* Introduce `git_buf_text_is_binary()` and `git_buf_text_contains_nul()` for
733 consumers to perform binary detection on a git_buf.
734
735* `git_branch_upstream_remote()` has been introduced to provide the
736 branch.<name>.remote configuration value.
737
738* Introduce `git_describe_commit()` and `git_describe_workdir()` to provide
739 a description of the current commit (and working tree, respectively)
740 based on the nearest tag or reference
741
742* Introduce `git_merge_bases()` and the `git_oidarray` type to expose all
7db0e6ee 743 merge bases between two commits.
eca07bcd 744
b91f28be 745* Introduce `git_merge_bases_many()` to expose all merge bases between
eca07bcd 746 multiple commits.
67917281 747
67917281 748* Introduce rebase functionality (using the merge algorithm only).
b91f28be
CMN
749 Introduce `git_rebase_init()` to begin a new rebase session,
750 `git_rebase_open()` to open an in-progress rebase session,
751 `git_rebase_commit()` to commit the current rebase operation,
752 `git_rebase_next()` to apply the next rebase operation,
753 `git_rebase_abort()` to abort an in-progress rebase and `git_rebase_finish()`
67917281
ET
754 to complete a rebase operation.
755
b91f28be
CMN
756* Introduce `git_note_author()` and `git_note_committer()` to get the author
757 and committer information on a `git_note`, respectively.
79b0ae4e 758
b91f28be
CMN
759* A factory function for ssh has been added which allows to change the
760 path of the programs to execute for receive-pack and upload-pack on
761 the server, `git_transport_ssh_with_paths()`.
21083a71 762
b91f28be
CMN
763* The ssh transport supports asking the remote host for accepted
764 credential types as well as multiple challeges using a single
765 connection. This requires to know which username you want to connect
766 as, so this introduces the USERNAME credential type which the ssh
767 transport will use to ask for the username.
d88766c4 768
b91f28be
CMN
769* The `GIT_EPEEL` error code has been introduced when we cannot peel a tag
770 to the requested object type; if the given object otherwise cannot be
771 peeled, `GIT_EINVALIDSPEC` is returned.
68182085 772
b91f28be
CMN
773* Introduce `GIT_REPOSITORY_INIT_RELATIVE_GITLINK` to use relative paths
774 when writing gitlinks, as is used by git core for submodules.
e284c451 775
b91f28be 776* `git_remote_prune()` has been added. See above for description.
799e22ea 777
8aba3d47 778
b91f28be
CMN
779* Introduce reference transactions, which allow multiple references to
780 be locked at the same time and updates be queued. This also allows
781 us to safely update a reflog with arbitrary contents, as we need to
782 do for stash.
6d91dc53 783
b91f28be 784### API removals
dce7b1a4 785
b91f28be
CMN
786* `git_remote_supported_url()` and `git_remote_is_valid_url()` have been
787 removed as they have become essentially useless with rsync-style ssh paths.
788
789* `git_clone_into()` and `git_clone_local_into()` have been removed from the
790 public API in favour of `git_clone callbacks`.
791
792* The option to ignore certificate errors via `git_remote_cert_check()`
793 is no longer present. Instead, `git_remote_callbacks` has gained a new
794 entry which lets the user perform their own certificate checks.
795
796### Breaking API changes
208a2c8a 797
b91f28be
CMN
798* `git_cherry_pick()` is now `git_cherrypick()`.
799
800* The `git_submodule_update()` function was renamed to
801 `git_submodule_update_strategy()`. `git_submodule_update()` is now used to
802 provide functionalty similar to "git submodule update".
803
804* `git_treebuilder_create()` was renamed to `git_treebuilder_new()` to better
208a2c8a
CMN
805 reflect it being a constructor rather than something which writes to
806 disk.
40d79154 807
b91f28be
CMN
808* `git_treebuilder_new()` (was `git_treebuilder_create()`) now takes a
809 repository so that it can query repository configuration.
810 Subsequently, `git_treebuilder_write()` no longer takes a repository.
aad27e6e 811
b91f28be
CMN
812* `git_threads_init()` and `git_threads_shutdown()` have been renamed to
813 `git_libgit2_init()` and `git_libgit2_shutdown()` to better explain what
814 their purpose is, as it's grown to be more than just about threads.
aad27e6e 815
b91f28be
CMN
816* `git_libgit2_init()` and `git_libgit2_shutdown()` now return the number of
817 initializations of the library, so consumers may schedule work on the
818 first initialization.
aad27e6e 819
b91f28be
CMN
820* The `git_transport_register()` function no longer takes a priority and takes
821 a URL scheme name (eg "http") instead of a prefix like "http://"
aad27e6e 822
b91f28be
CMN
823* `git_index_name_entrycount()` and `git_index_reuc_entrycount()` now
824 return size_t instead of unsigned int.
9d1f97df 825
b91f28be
CMN
826* The `context_lines` and `interhunk_lines` fields in `git_diff`_options are
827 now `uint32_t` instead of `uint16_t`. This allows to set them to `UINT_MAX`,
828 in effect asking for "infinite" context e.g. to iterate over all the
829 unmodified lines of a diff.
974d21c8 830
b91f28be
CMN
831* `git_status_file()` now takes an exact path. Use `git_status_list_new()` if
832 pathspec searching is needed.
974d21c8 833
b91f28be
CMN
834* `git_note_create()` has changed the position of the notes reference
835 name to match `git_note_remove()`.
974d21c8 836
b91f28be
CMN
837* Rename `git_remote_load()` to `git_remote_lookup()` to bring it in line
838 with the rest of the lookup functions.
974d21c8 839
b91f28be
CMN
840* `git_remote_rename()` now takes the repository and the remote's
841 current name. Accepting a remote indicates we want to change it,
842 which we only did partially. It is much clearer if we accept a name
843 and no loaded objects are changed.
974d21c8 844
b91f28be
CMN
845* `git_remote_delete()` now accepts the repository and the remote's name
846 instead of a loaded remote.
974d21c8 847
b91f28be
CMN
848* `git_merge_head` is now `git_annotated_commit`, to better reflect its usage
849 for multiple functions (including rebase)
974d21c8 850
b91f28be
CMN
851* The `git_clone_options` struct no longer provides the `ignore_cert_errors` or
852 `remote_name` members for remote customization.
974d21c8 853
b91f28be
CMN
854 Instead, the `git_clone_options` struct has two new members, `remote_cb` and
855 `remote_cb_payload`, which allow the caller to completely override the remote
856 creation process. If needed, the caller can use this callback to give their
857 remote a name other than the default (origin) or disable cert checking.
974d21c8 858
b91f28be
CMN
859 The `remote_callbacks` member has been preserved for convenience, although it
860 is not used when a remote creation callback is supplied.
974d21c8 861
b91f28be
CMN
862* The `git_clone`_options struct now provides `repository_cb` and
863 `repository_cb_payload` to allow the user to create a repository with
864 custom options.
974d21c8 865
b91f28be
CMN
866* The `git_push` struct to perform a push has been replaced with
867 `git_remote_upload()`. The refspecs and options are passed as a
868 function argument. `git_push_update_tips()` is now also
869 `git_remote_update_tips()` and the callbacks are in the same struct as
870 the rest.
974d21c8 871
b91f28be
CMN
872* The `git_remote_set_transport()` function now sets a transport factory function,
873 rather than a pre-existing transport instance.
61cd037e 874
b91f28be
CMN
875* The `git_transport` structure definition has moved into the sys/transport.h
876 file.
877
878* libgit2 no longer automatically sets the OpenSSL locking
879 functions. This is not something which we can know to do. A
880 last-resort convenience function is provided in sys/openssl.h,
881 `git_openssl_set_locking()` which can be used to set the locking.