Raw
1 Git v2.56 Release Notes
2 =======================
3
4 UI, Workflows & Features
5 ------------------------
6
7 * Advice shown by "git status" when the local branch is behind or has
8 diverged from its push branch has been updated to suggest "git pull
9 <remote> <branch>".
10
11 * The handling of promisor-remote protocol capability has been updated
12 to allow the other side to add to the list of promisor remotes via the
13 'promisor.acceptFromServerURL' configuration variable.
14
15 * The 'ort' merge backend has been hardened against corrupt trees by
16 ensuring it aborts under appropriate error conditions.
17
18 * The `fetch.followRemoteHEAD` configuration variable has been added to
19 provide a default for the per-remote `remote.<name>.followRemoteHEAD`
20 setting.
21
22 * "git log --follow" has been updated to better handle non-linear
23 history, in which the path being tracked gets renamed differently in
24 multiple history lines.
25
26 * The "git repo info" command has been taught new keys to output both
27 absolute and relative paths for "gitdir" and "commondir", supported by
28 a new path-formatting helper extracted from "git rev-parse".
29
30 * When 'git push origin/main' or 'git branch origin main' is run, the
31 command is now recognized as a potential typo, and advice has been
32 added to offer a typo fix.
33
34 * The 'git refs' toolbox has been extended with new 'create', 'delete',
35 'update', and 'rename' subcommands to create, delete, update, and
36 rename references, respectively.
37
38 * The experimental 'git history' command has been taught a new 'drop'
39 subcommand to remove a commit, with its descendants replayed onto its
40 parent.
41
42 * The alignment of commit object name abbreviations in 'git blame'
43 output has been optimized to reserve a column for marks (caret,
44 question mark, or asterisk) only when such marks are actually shown.
45
46 * Option parsing with 'git rev-parse --parseopt' and in most 'git'
47 subcommands has been updated to exit with 0 (instead of 129) when the
48 help option ('-h' or '--help') is requested directly by the user,
49 aligning with standard Unix convention.
50
51 * The '[includeIf "condition"]' conditional inclusion facility for
52 configuration files has been taught to use the location of the
53 worktree in its condition.
54
55 * The usage string and SYNOPSIS for 'git fast-export' have been
56 standardized to make them consistent with each other and with other
57 commands.
58
59 * 'git log --graph' has been modified to visually distinguish parentless
60 'root' commits (and commits that become roots due to history
61 simplification) by indenting them, preventing them from appearing
62 falsely related to unrelated commits rendered immediately above them.
63
64 * Userdiff patterns for Swift have been added, with support for
65 Swift-specific constructs such as attributes, modifiers, failable
66 initializers, and generics.
67
68 * Configuration file locking has been updated to retry for a short
69 period, avoiding failures when multiple processes attempt to update
70 the configuration simultaneously.
71
72 * The 'remote-object-info' command has been added to 'git cat-file
73 --batch-command', allowing clients to request object metadata
74 (currently size) from a remote server via protocol v2 without
75 downloading the entire object. Format placeholders are dynamically
76 filtered on the client based on server-advertised capabilities,
77 returning empty strings for inapplicable or unsupported fields.
78
79
80 Performance, Internal Implementation, Development Support etc.
81 --------------------------------------------------------------
82
83 * The refactoring of 'setup.c' has been continued to drop remaining
84 global state (`git_work_tree_cfg`, `is_bare_repository_cfg`), updating
85 `is_bare_repository()` to no longer implicitly rely on
86 `the_repository`.
87
88 * Project-specific configuration for b4 has been introduced, and the
89 documentation has been updated to recommend using it as a
90 streamlined method for submitting patches.
91
92 * The default format path of git cat-file --batch has been optimized
93 to use strbuf_add_oid_hex() and strbuf_add_uint() instead of
94 strbuf_addf(), yielding a noticeable speedup.
95
96 * Commands that list branches and tags (like git branch and git tag)
97 have been optimized to pass the namespace prefix when initializing
98 their ref iterator, avoiding a loose-ref scaling regression in
99 repositories with many unrelated loose references.
100
101 * The packed object source has been refactored into a proper struct
102 odb_source.
103
104 * The global configuration variables protect_hfs and protect_ntfs have
105 been migrated into struct repo_config_values to tie them to
106 per-repository configuration state.
107
108 * The trailer sections in SubmittingPatches have been updated to
109 encourage use of standard trailers.
110
111 * The documentation in SubmittingPatches has been updated to clarify how
112 patch contributors should respond to design and viability critiques,
113 and how the resolution of such critiques should be recorded in the
114 final commit messages.
115
116 * The pack-objects command has been updated to support reachability
117 bitmaps and delta-islands concurrently with the `--path-walk` option,
118 allowing faster packaging by falling back to path-walk when bitmaps
119 cannot fully satisfy the request.
120
121 * Documentation on community contribution guidelines has been updated to
122 encourage replying to review comments before rerolling, and to advise
123 a default limit of at most one reroll per day to give reviewers across
124 different time zones enough time to participate.
125
126 * The lazy priority queue optimization pattern (deferring actual removal
127 in 'prio_queue_get()' to allow get+put fusion) has been folded
128 directly into 'prio_queue' itself, speeding up commit traversal
129 workflows and simplifying callers.
130
131 * The 'reprepare()' callback for object database sources has been
132 generalized into a 'prepare()' callback with an optional flush cache
133 flag, and a new 'odb_prepare()' wrapper has been introduced to allow
134 pre-opening object database sources.
135
136 * The 'whence' field in 'struct object_info' has been removed. The
137 backend-specific object information retrieval has been refactored into
138 an opt-in 'struct object_info_source' structure.
139
140 * A racy build failure under Meson has been corrected by ensuring that
141 the generated header file 'hook-list.h' is built before compiling
142 files in 'builtin_sources' that depend on it.
143
144 * The repository discovery and repository configuration phases, which
145 were previously intertwined in 'setup.c', have been split. Repository
146 discovery has been updated to populate a 'struct repo_discovery'
147 without modifying the repository state, which is then taken by
148 repository configuration to initialize the repository, paving the way
149 for clean unification of repository configuration.
150
151 * The 'SubmittingPatches' document has been updated to explicitly
152 describe the expectation for contributors to retract or abandon their
153 patch series when they are no longer pursuing it.
154
155 * The contributor guide has been updated to advise new contributors to
156 trim irrelevant quoted text when replying to review comments, matching
157 the existing advice given to reviewers.
158
159 * The build system has been updated to support building universal macOS
160 binaries when 'Rust' is enabled, by compiling separate static archives
161 for each target triple listed in 'RUST_TARGETS' and combining them
162 using the macOS 'lipo' tool. The 'git-credential-osxkeychain' helper
163 has been updated to link against '$(RUST_LIB)' when 'Rust' is enabled.
164
165 * The test suite has been updated to use the 'test_grep' helper instead
166 of bare 'grep' for test assertions, allowing file contents to be
167 printed on failure for easier debugging. A new 'greplint' linter has
168 been introduced to detect and prevent new bare 'grep' assertions from
169 being added to the test suite.
170
171 * The pipelines in 't1410-reflog.sh' have been replaced with the
172 'test_stdout_line_count' helper to avoid suppressing the exit code of
173 'git' commands, ensuring failures are not hidden from the test suite.
174
175 * The cache-scanning loop in 'next_cache_entry()' has been optimized
176 to avoid rescanning already-unpacked index entries, preventing a
177 quadratic performance slow-down when diffing the working tree
178 against a commit with a pathspec matching early index entries.
179
180 * The global configuration variable 'ignore_case' (representing the
181 'core.ignorecase' configuration) has been migrated into 'struct
182 repo_config_values' to tie it to a specific repository instance.
183
184 * The performance of ref updates and reads using the 'reftable' backend
185 in the presence of many deletion tombstone records has been optimized
186 by removing the tombstone suppression flag from the merged iterator
187 and instead skipping tombstones at higher-level call sites where
188 iteration bounds are known.
189
190 * Various code paths have been hardened against potential NULL-pointer
191 dereferences and invalid file descriptor accesses flagged by
192 Coverity.
193
194 * The in-tree 'b4' cover letter template has been updated to include the
195 'change-id' trailer, ensuring that sent tags generated by 'b4' contain
196 the required tracking information for subsequent runs.
197
198 * 'git receive-pack' has been refactored to use ODB transaction
199 interfaces instead of directly managing 'tmp_objdir' for staging
200 incoming objects, bringing it closer to being ODB backend agnostic.
201
202 * The test script 't/t9811-git-p4-label-import.sh' has been
203 modernized to use 'test_path_is_file' and 'test_path_is_missing'
204 instead of raw 'test -f' and '! test -f' calls.
205
206 * A redundant strbuf_reset() call in the 'HAVE_GETDELIM' path of
207 strbuf_getwholeline() has been removed, as getdelim() overwrites the
208 buffer and the length is updated afterward.
209
210 * The object database enumeration interface odb_for_each_object() has
211 been taught to accept object filters, allowing the underlying backends
212 to optimize the traversal by using reachability bitmaps when
213 available. 'git cat-file --batch-all-objects' has been updated to use
214 this generic interface, simplifying its code and avoiding direct
215 access to ODB backend internals.
216
217 * The test script 't/t1100-commit-tree-options.sh' has been modernized
218 by converting test cases to the modern style (using single quotes and
219 tab indentation) and moving the creation of the expected file inside
220 the setup test so it runs under the protection of the test harness.
221
222 * The test script 't/t7614-merge-signoff.sh' has been updated to avoid
223 suppressing the exit code of 'git' commands in a pipe.
224
225 * The 'git rev-list --no-walk' command has been corrected to restore
226 pathspec filtering, which was lost when the streaming walk was
227 refactored.
228
229 * The ref subsystem and the worktree API have been refactored to pass a
230 repository pointer down the call chain, allowing them to drop
231 references to the global 'the_repository' variable. As part of this,
232 the handling of the 'core.packedRefsTimeout' configuration has been
233 moved into the per-repository ref store structure.
234
235 * 'git branch --contains' and 'git for-each-ref --contains' have been
236 optimized to use the memoized commit traversal previously used only by
237 'git tag --contains', significantly speeding up connectivity checks
238 across many candidate refs with shared history.
239
240 * The passing of push destination specifications in the 'remote-curl'
241 helper has been simplified by removing the explicit 'count' parameter
242 and relying on the NULL-termination of the array.
243
244 * The dependency on the global 'the_repository' variable in the
245 'refspec.c' API has been removed by passing the hash algorithm
246 explicitly to refspec-parsing functions and storing it in 'struct
247 refspec'.
248
249 * The enumeration of untracked and ignored files in 'git status' has
250 been optimized by avoiding quadratic complexity when inserting into
251 string lists, reducing the construction cost from O(n^2) to O(n log
252 n).
253
254 * The copy_file() and copy_file_with_time() functions have been
255 refactored to take a repository parameter, allowing the removal of the
256 implicit dependency on the global 'the_repository' variable in
257 'copy.c'.
258
259 * The tempfile and lockfile APIs have been refactored to stop depending
260 on the 'the_repository' global variable, and their callers have been
261 updated to use the repository-aware variants.
262
263 * The 'trust_executable_bit' (coming from the 'core.filemode'
264 configuration) has been migrated into 'struct repo_config_values' to
265 tie it to a specific repository instance.
266
267 * The 'excludes_file' and various other global configuration variables
268 (including 'editor_program', 'pager_program', 'askpass_program', and
269 'push_default') have been migrated into the per-repository structure.
270
271 * The 'git stash push' command has been optimized to avoid unnecessary
272 sparse index expansion when pathspecs are wholly inside the
273 sparse-checkout cone. Also, a potential out-of-bounds read in the
274 sparse-index expansion check helper pathspec_needs_expanded_index()
275 has been fixed by consistently using the parsed, prefixed path.
276
277 * The logic to write loose objects has been refactored and moved from
278 'object-file.c' to the loose backend source file 'odb/source-loose.c',
279 making the loose backend more self-contained. This is achieved by
280 first refactoring force_object_loose() to use generic ODB write
281 interfaces instead of loose-backend internals.
282
283
284 Fixes since v2.55
285 -----------------
286
287 * A regression in the error diagnosis code for invalid .git files has
288 been fixed, avoiding a potential NULL-pointer crash when reporting
289 that a .git file does not point to a valid repository.
290 (merge 54a441bcea jk/setup-gitfile-diag-fix later to maint).
291
292 * Support for hashing loose or packed objects larger than 4GB on Windows
293 and other LLP64 platforms has been improved by converting object header
294 buffers and data-handling functions from 'unsigned long' to 'size_t'.
295 (merge d99e13d0be po/hash-object-size-t later to maint).
296
297 * The display of the rebase todo list in "git status" has been
298 improved to correctly abbreviate object IDs for more commands and
299 avoid misinterpreting refs as object IDs.
300 (merge 6f34e5f9e3 pw/status-rebase-todo later to maint).
301
302 * Reference backend configuration has been updated to load lazily to
303 avoid recursive calls during repository initialization when 'onbranch'
304 configuration conditions are evaluated. This has also fixed a memory
305 leak and allowed the unused `chdir_notify_reparent()` machinery to be
306 dropped.
307 (merge d6522d01df ps/refs-onbranch-fixes later to maint).
308
309 * The connectivity check has been refactored to search for promisor
310 objects in a generic way using the object database interface,
311 rather than iterating packfiles directly. This allows connectivity
312 checks to work properly in repositories that do not use packfiles.
313 (merge 66ee9cb930 ps/connected-generic-promisor-checks later to maint).
314
315 * A test checking interactions between git rebase --quit and
316 autostash in t3420-rebase-autostash.sh has been corrected to use
317 test_path_is_missing instead of ! grep on a file that shouldn't
318 exist in the conflicted state.
319 (merge eaad121fef sg/t3420-do-not-grep-in-missing-file later to maint).
320
321 * The GPG and SSH signature parsing code has been corrected to strip
322 carriage return characters only when they immediately precede line
323 feeds, instead of unconditionally stripping all carriage returns.
324 (merge 5dea8b690b ad/gpg-strip-cr-before-lf later to maint).
325
326 * A memory leak in the 'reftable_writer_new()' initialization function
327 has been fixed by delaying the allocation of 'struct reftable_writer'
328 until after input options are validated.
329 (merge c6fb3b9c3e jk/reftable-leakfix later to maint).
330
331 * A memory leak in the '--base' handling of 'git format-patch' has been
332 plugged, and the leak reporting of the test suite when running under a
333 TAP harness has been improved.
334 (merge 973a0373ff jk/format-patch-leakfix later to maint).
335
336 * A write file stream resource leak has been fixed as part of a code
337 cleanup.
338 (merge ebb4d2ffa3 jc/history-message-prep-fix later to maint).
339
340 * Various memory leaks in the Bloom-filter code paths that are exposed
341 when running tests with the 'GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1'
342 environment variable have been plugged.
343 (merge 459088ec2e jk/bloom-leak-fixes later to maint).
344
345 * The wincred credential helper has been updated to avoid memory
346 corruption when erasing credentials and to prevent silent
347 credential loss when storing OAuth tokens, by correcting buffer
348 allocations and arguments passed to safe-CRT APIs.
349 (merge f635ab9ab4 js/wincred-fixes later to maint).
350
351 * Various code paths that initialize a cryptographic hash context but
352 bail out or finish without calling 'git_hash_final()' have been taught
353 to call 'git_hash_discard()' to release allocated resources, fixing
354 memory leaks when Git is built with non-default backends like
355 'OpenSSL' or 'libgcrypt'.
356 (merge 600588d2aa jk/hash-algo-leak-fixes later to maint).
357
358 * Various resource leaks, invalid file descriptor closures, and process
359 handle ownership issues flagged by Coverity have been fixed.
360 (merge 9184231173 js/coverity-fixes later to maint).
361
362 * Dockerized CI jobs running in private GitHub repositories have been
363 adjusted to use explicit process and file limits, preventing resource
364 exhaustion errors on private runners.
365 (merge bad766fbac js/ci-dockerized-pid-limit later to maint).
366
367 * Various test scripts have been updated to clean up large temporary
368 files and repositories, reducing peak disk usage during testing.
369 Also, expensive tests have been disabled on platforms that lack
370 sufficient resources (like 32-bit platforms and Windows CI runners),
371 and the long test suite has been enabled in GitLab CI.
372 (merge 84248444ad ps/t-fixes-for-git-test-long later to maint).
373
374 * The UTF-8 precomposition wrapper on macOS has been updated to use a
375 flexible array member to represent the name of a directory entry,
376 preventing fortified libc checks from failing when the name is
377 reallocated to be larger than 'NAME_MAX' bytes.
378 (merge 1eb281159f ih/precompose-flex-array later to maint).
379
380 * The 'git_hash_*()' wrappers have been updated to be used consistently
381 across the codebase instead of direct calls to members of 'struct
382 git_hash_algo', and 'git_hash_discard()' has been made idempotent to
383 simplify cleanups.
384 (merge 9e396aa553 jk/git-hash-cleanups later to maint).
385
386 * The sideband demultiplexer has been updated to recognize ANSI SGR
387 escape sequences that use colon-separated subfields (e.g., for
388 256-color or true-color codes).
389 (merge 3792b2aea4 mm/sideband-ansi-sgr-colon-fix later to maint).
390
391 * The 'reftable' code has been hardened against corrupted tables by
392 fixing out-of-bounds writes, out-of-bounds reads, and abort calls
393 during parsing.
394 (merge ca93c27328 ps/reftable-hardening later to maint).
395
396 * A description in the release notes for Git 2.55.0 has been
397 retroactively updated to clarify that Rust support is enabled by
398 default, but still optional, and will become mandatory in Git 3.0.
399 (merge 18b2009d14 jc/relnotes-2.55-rust-fix later to maint).
400
401 * The early-exit optimization in 'paint_down_to_common()' has been
402 gated on the queue being generation-ordered, fixing a bug where
403 'git merge-base' (without '--all') could return incorrect results
404 on repositories with v1 commit graphs and clock skew.
405 (merge ae68032a8d kk/commit-reach-find-all-fix later to maint).
406
407 * The client-side parser of the server-advertised bundle-URI list has
408 been updated to drain the remaining response in order to avoid
409 protocol desynchronization when the server sends a misconfigured list.
410 Also, the server-side has been taught to omit empty configuration
411 values instead of sending invalid key-value lines.
412 (merge 50de1169e4 tc/bundle-uri-empty-fix later to maint).
413
414 * The 'topo_levels' slab was propagated only to the topmost layer of a
415 split commit-graph chain, causing topological levels for commits in
416 base layers to be recomputed during incremental writes. This has been
417 corrected.
418
419 * The stream-based object signature verification path has been
420 corrected to avoid double-closing the stream on read errors.
421 (merge cfd52a74a0 ps/odb-stream-double-close-fix later to maint).
422
423 * The '-i' shorthand for the '--init' option, which was accepted by the
424 'git submodule update' command until it was broken in a modernization
425 of the option-parsing code, has been restored.
426 (merge ff1da37f58 dm/submodule-update-i-shorthand later to maint).
427
428 * An accidental use of the '%zu' format specifier in 'git
429 submodule--helper' has been corrected to use 'PRIuMAX' and cast the
430 value to 'uintmax_t' to avoid portability issues.
431 (merge 3279c13c00 jc/submodule-helper-avoid-zu later to maint).
432
433 * The rebase post-rewrite notes-copying logic has been corrected. When
434 a commit is dropped during rebase (e.g., because its changes are
435 already upstream), it is no longer recorded as rewritten, preventing
436 its notes from being copied to an unrelated commit.
437 (merge 42554b78fd pw/rebase-drop-notes-with-commit later to maint).
438
439 * A few memory problems in the Rust interface to C hash functions have
440 been corrected. The 'Clone' implementation of 'CryptoHasher' now
441 properly initializes the context before cloning, and its 'Drop'
442 implementation now discards the context to prevent leaks.
443
444 * The object ID shortening and linking in the 'commitdiff' view of
445 'gitweb' has been corrected to work even when the index line carries
446 a trailing file mode.
447 (merge fda513d6fe tl/gitweb-shorten-hashes-with-modes later to maint).
448
449 * When the push remote is specified as a URL, the fetch refspec of a
450 uniquely matching configured remote is now used to find and update
451 the remote-tracking branch (e.g., '@{push}').
452
453 * Traversals with '--exclude-first-parent-only' have been corrected
454 to properly stop after the first parent even when it has already
455 been marked as 'SEEN'.
456 (merge 47382f7398 jc/exclude-first-parent-seen later to maint).
457
458 * A segfault when 'git clone --revision' talks to a server that does not
459 support protocol v2 (falling back to protocol v0) has been corrected.
460 (merge 1034ad383f af/clone-revision-v0-segfault-fix later to maint).
461
462 * rewrites_release() in 'remote.c' has been updated to free 'struct
463 rewrite' instances, their '.instead_of' arrays, and their contents.
464 (merge dcef3bf041 jc/remote-insteadof-leakfix later to maint).
465
466 * The remote-matching logic for submodules has been corrected to resolve
467 'url.*.insteadOf' aliases before comparing the inventoried URL from
468 '.gitmodules' with the URLs of configured remotes.