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