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