| 1 | Git 2.31 Release Notes |
| 2 | ====================== |
| 3 | |
| 4 | Updates since v2.30 |
| 5 | ------------------- |
| 6 | |
| 7 | Backward incompatible and other important changes |
| 8 | |
| 9 | * The "pack-redundant" command, which has been left stale with almost |
| 10 | unusable performance issues, now warns loudly when it gets used, as |
| 11 | we no longer want to recommend its use (instead just "repack -d" |
| 12 | instead). |
| 13 | |
| 14 | * The development community has adopted Contributor Covenant v2.0 to |
| 15 | update from v1.4 that we have been using. |
| 16 | |
| 17 | * The support for deprecated PCRE1 library has been dropped. |
| 18 | |
| 19 | * Fixes for CVE-2021-21300 in Git 2.30.2 (and earlier) is included. |
| 20 | |
| 21 | |
| 22 | UI, Workflows & Features |
| 23 | |
| 24 | * The "--format=%(trailers)" mechanism gets enhanced to make it |
| 25 | easier to design output for machine consumption. |
| 26 | |
| 27 | * When a user does not tell "git pull" to use rebase or merge, the |
| 28 | command gives a loud message telling a user to choose between |
| 29 | rebase or merge but creates a merge anyway, forcing users who would |
| 30 | want to rebase to redo the operation. Fix an early part of this |
| 31 | problem by tightening the condition to give the message---there is |
| 32 | no reason to stop or force the user to choose between rebase or |
| 33 | merge if the history fast-forwards. |
| 34 | |
| 35 | * The configuration variable 'core.abbrev' can be set to 'no' to |
| 36 | force no abbreviation regardless of the hash algorithm. |
| 37 | |
| 38 | * "git rev-parse" can be explicitly told to give output as absolute |
| 39 | or relative path with the `--path-format=(absolute|relative)` option. |
| 40 | |
| 41 | * Bash completion (in contrib/) update to make it easier for |
| 42 | end-users to add completion for their custom "git" subcommands. |
| 43 | |
| 44 | * "git maintenance" learned to drive scheduled maintenance on |
| 45 | platforms whose native scheduling methods are not 'cron'. |
| 46 | |
| 47 | * After expiring a reflog and making a single commit, the reflog for |
| 48 | the branch would record a single entry that knows both @{0} and |
| 49 | @{1}, but we failed to answer "what commit were we on?", i.e. @{1} |
| 50 | |
| 51 | * "git bundle" learns "--stdin" option to read its refs from the |
| 52 | standard input. Also, it now does not lose refs whey they point |
| 53 | at the same object. |
| 54 | |
| 55 | * "git log" learned a new "--diff-merges=<how>" option. |
| 56 | |
| 57 | * "git ls-files" can and does show multiple entries when the index is |
| 58 | unmerged, which is a source for confusion unless -s/-u option is in |
| 59 | use. A new option --deduplicate has been introduced. |
| 60 | |
| 61 | * `git worktree list` now annotates worktrees as prunable, shows |
| 62 | locked and prunable attributes in --porcelain mode, and gained |
| 63 | a --verbose option. |
| 64 | |
| 65 | * "git clone" tries to locally check out the branch pointed at by |
| 66 | HEAD of the remote repository after it is done, but the protocol |
| 67 | did not convey the information necessary to do so when copying an |
| 68 | empty repository. The protocol v2 learned how to do so. |
| 69 | |
| 70 | * There are other ways than ".." for a single token to denote a |
| 71 | "commit range", namely "<rev>^!" and "<rev>^-<n>", but "git |
| 72 | range-diff" did not understand them. |
| 73 | |
| 74 | * The "git range-diff" command learned "--(left|right)-only" option |
| 75 | to show only one side of the compared range. |
| 76 | |
| 77 | * "git mergetool" feeds three versions (base, local and remote) of |
| 78 | a conflicted path unmodified. The command learned to optionally |
| 79 | prepare these files with unconflicted parts already resolved. |
| 80 | |
| 81 | * The .mailmap is documented to be read only from the root level of a |
| 82 | working tree, but a stray file in a bare repository also was read |
| 83 | by accident, which has been corrected. |
| 84 | |
| 85 | * "git maintenance" tool learned a new "pack-refs" maintenance task. |
| 86 | |
| 87 | * The error message given when a configuration variable that is |
| 88 | expected to have a boolean value has been improved. |
| 89 | |
| 90 | * Signed commits and tags now allow verification of objects, whose |
| 91 | two object names (one in SHA-1, the other in SHA-256) are both |
| 92 | signed. |
| 93 | |
| 94 | * "git rev-list" command learned "--disk-usage" option. |
| 95 | |
| 96 | * "git {diff,log} --{skip,rotate}-to=<path>" allows the user to |
| 97 | discard diff output for early paths or move them to the end of the |
| 98 | output. |
| 99 | |
| 100 | * "git difftool" learned "--skip-to=<path>" option to restart an |
| 101 | interrupted session from an arbitrary path. |
| 102 | |
| 103 | * "git grep" has been tweaked to be limited to the sparse checkout |
| 104 | paths. |
| 105 | |
| 106 | * "git rebase --[no-]fork-point" gained a configuration variable |
| 107 | rebase.forkPoint so that users do not have to keep specifying a |
| 108 | non-default setting. |
| 109 | |
| 110 | |
| 111 | Performance, Internal Implementation, Development Support etc. |
| 112 | |
| 113 | * A 3-year old test that was not testing anything useful has been |
| 114 | corrected. |
| 115 | |
| 116 | * Retire more names with "sha1" in it. |
| 117 | |
| 118 | * The topological walk codepath is covered by new trace2 stats. |
| 119 | |
| 120 | * Update the Code-of-conduct to version 2.0 from the upstream (we've |
| 121 | been using version 1.4). |
| 122 | |
| 123 | * "git mktag" validates its input using its own rules before writing |
| 124 | a tag object---it has been updated to share the logic with "git |
| 125 | fsck". |
| 126 | |
| 127 | * Two new ways to feed configuration variable-value pairs via |
| 128 | environment variables have been introduced, and the way |
| 129 | GIT_CONFIG_PARAMETERS encodes variable/value pairs has been tweaked |
| 130 | to make it more robust. |
| 131 | |
| 132 | * Tests have been updated so that they do not to get affected by the |
| 133 | name of the default branch "git init" creates. |
| 134 | |
| 135 | * "git fetch" learns to treat ref updates atomically in all-or-none |
| 136 | fashion, just like "git push" does, with the new "--atomic" option. |
| 137 | |
| 138 | * The peel_ref() API has been replaced with peel_iterated_oid(). |
| 139 | |
| 140 | * The .use_shell flag in struct child_process that is passed to |
| 141 | run_command() API has been clarified with a bit more documentation. |
| 142 | |
| 143 | * Document, clean-up and optimize the code around the cache-tree |
| 144 | extension in the index. |
| 145 | |
| 146 | * The ls-refs protocol operation has been optimized to narrow the |
| 147 | sub-hierarchy of refs/ it walks to produce response. |
| 148 | |
| 149 | * When removing many branches and tags, the code used to do so one |
| 150 | ref at a time. There is another API it can use to delete multiple |
| 151 | refs, and it makes quite a lot of performance difference when the |
| 152 | refs are packed. |
| 153 | |
| 154 | * The "pack-objects" command needs to iterate over all the tags when |
| 155 | automatic tag following is enabled, but it actually iterated over |
| 156 | all refs and then discarded everything outside "refs/tags/" |
| 157 | hierarchy, which was quite wasteful. |
| 158 | |
| 159 | * A perf script was made more portable. |
| 160 | |
| 161 | * Our setting of GitHub CI test jobs were a bit too eager to give up |
| 162 | once there is even one failure found. Tweak the knob to allow |
| 163 | other jobs keep running even when we see a failure, so that we can |
| 164 | find more failures in a single run. |
| 165 | |
| 166 | * We've carried compatibility codepaths for compilers without |
| 167 | variadic macros for quite some time, but the world may be ready for |
| 168 | them to be removed. Force compilation failure on exotic platforms |
| 169 | where variadic macros are not available to find out who screams in |
| 170 | such a way that we can easily revert if it turns out that the world |
| 171 | is not yet ready. |
| 172 | |
| 173 | * Code clean-up to ensure our use of hashtables using object names as |
| 174 | keys use the "struct object_id" objects, not the raw hash values. |
| 175 | |
| 176 | * Lose the debugging aid that may have been useful in the past, but |
| 177 | no longer is, in the "grep" codepaths. |
| 178 | |
| 179 | * Some pretty-format specifiers do not need the data in commit object |
| 180 | (e.g. "%H"), but we were over-eager to load and parse it, which has |
| 181 | been made even lazier. |
| 182 | |
| 183 | * Get rid of "GETTEXT_POISON" support altogether, which may or may |
| 184 | not be controversial. |
| 185 | |
| 186 | * Introduce an on-disk file to record revindex for packdata, which |
| 187 | traditionally was always created on the fly and only in-core. |
| 188 | |
| 189 | * The commit-graph learned to use corrected commit dates instead of |
| 190 | the generation number to help topological revision traversal. |
| 191 | |
| 192 | * Piecemeal of rewrite of "git bisect" in C continues. |
| 193 | |
| 194 | * When a pager spawned by us exited, the trace log did not record its |
| 195 | exit status correctly, which has been corrected. |
| 196 | |
| 197 | * Removal of GIT_TEST_GETTEXT_POISON continues. |
| 198 | |
| 199 | * The code to implement "git merge-base --independent" was poorly |
| 200 | done and was kept from the very beginning of the feature. |
| 201 | |
| 202 | * Preliminary changes to fsmonitor integration. |
| 203 | |
| 204 | * Performance improvements for rename detection. |
| 205 | |
| 206 | * The common code to deal with "chunked file format" that is shared |
| 207 | by the multi-pack-index and commit-graph files have been factored |
| 208 | out, to help codepaths for both filetypes to become more robust. |
| 209 | |
| 210 | * The approach to "fsck" the incoming objects in "index-pack" is |
| 211 | attractive for performance reasons (we have them already in core, |
| 212 | inflated and ready to be inspected), but fundamentally cannot be |
| 213 | applied fully when we receive more than one pack stream, as a tree |
| 214 | object in one pack may refer to a blob object in another pack as |
| 215 | ".gitmodules", when we want to inspect blobs that are used as |
| 216 | ".gitmodules" file, for example. Teach "index-pack" to emit |
| 217 | objects that must be inspected later and check them in the calling |
| 218 | "fetch-pack" process. |
| 219 | |
| 220 | * The logic to handle "trailer" related placeholders in the |
| 221 | "--format=" mechanisms in the "log" family and "for-each-ref" |
| 222 | family is getting unified. |
| 223 | |
| 224 | * Raise the buffer size used when writing the index file out from |
| 225 | (obviously too small) 8kB to (clearly sufficiently large) 128kB. |
| 226 | |
| 227 | * It is reported that open() on some platforms (e.g. macOS Big Sur) |
| 228 | can return EINTR even though our timers are set up with SA_RESTART. |
| 229 | A workaround has been implemented and enabled for macOS to rerun |
| 230 | open() transparently from the caller when this happens. |
| 231 | |
| 232 | |
| 233 | Fixes since v2.30 |
| 234 | ----------------- |
| 235 | |
| 236 | * Diagnose command line error of "git rebase" early. |
| 237 | |
| 238 | * Clean up option descriptions in "git cmd --help". |
| 239 | |
| 240 | * "git stash" did not work well in a sparsely checked out working |
| 241 | tree. |
| 242 | |
| 243 | * Some tests expect that "ls -l" output has either '-' or 'x' for |
| 244 | group executable bit, but setgid bit can be inherited from parent |
| 245 | directory and make these fields 'S' or 's' instead, causing test |
| 246 | failures. |
| 247 | |
| 248 | * "git for-each-repo --config=<var> <cmd>" should not run <cmd> for |
| 249 | any repository when the configuration variable <var> is not defined |
| 250 | even once. |
| 251 | |
| 252 | * Fix 2.29 regression where "git mergetool --tool-help" fails to list |
| 253 | all the available tools. |
| 254 | |
| 255 | * Fix for procedure to building CI test environment for mac. |
| 256 | |
| 257 | * The implementation of "git branch --sort" wrt the detached HEAD |
| 258 | display has always been hacky, which has been cleaned up. |
| 259 | |
| 260 | * Newline characters in the host and path part of git:// URL are |
| 261 | now forbidden. |
| 262 | |
| 263 | * "git diff" showed a submodule working tree with untracked cruft as |
| 264 | "Submodule commit <objectname>-dirty", but a natural expectation is |
| 265 | that the "-dirty" indicator would align with "git describe --dirty", |
| 266 | which does not consider having untracked files in the working tree |
| 267 | as source of dirtiness. The inconsistency has been fixed. |
| 268 | |
| 269 | * When more than one commit with the same patch ID appears on one |
| 270 | side, "git log --cherry-pick A...B" did not exclude them all when a |
| 271 | commit with the same patch ID appears on the other side. Now it |
| 272 | does. |
| 273 | |
| 274 | * Documentation for "git fsck" lost stale bits that has become |
| 275 | incorrect. |
| 276 | |
| 277 | * Doc fix for packfile URI feature. |
| 278 | |
| 279 | * When "git rebase -i" processes "fixup" insn, there is no reason to |
| 280 | clean up the commit log message, but we did the usual stripspace |
| 281 | processing. This has been corrected. |
| 282 | (merge f7d42ceec5 js/rebase-i-commit-cleanup-fix later to maint). |
| 283 | |
| 284 | * Fix in passing custom args from "git clone" to "upload-pack" on the |
| 285 | other side. |
| 286 | (merge ad6b5fefbd jv/upload-pack-filter-spec-quotefix later to maint). |
| 287 | |
| 288 | * The command line completion (in contrib/) completed "git branch -d" |
| 289 | with branch names, but "git branch -D" offered tagnames in addition, |
| 290 | which has been corrected. "git branch -M" had the same problem. |
| 291 | (merge 27dc071b9a jk/complete-branch-force-delete later to maint). |
| 292 | |
| 293 | * When commands are started from a subdirectory, they may have to |
| 294 | compare the path to the subdirectory (called prefix and found out |
| 295 | from $(pwd)) with the tracked paths. On macOS, $(pwd) and |
| 296 | readdir() yield decomposed path, while the tracked paths are |
| 297 | usually normalized to the precomposed form, causing mismatch. This |
| 298 | has been fixed by taking the same approach used to normalize the |
| 299 | command line arguments. |
| 300 | (merge 5c327502db tb/precompose-prefix-too later to maint). |
| 301 | |
| 302 | * Even though invocations of "die()" were logged to the trace2 |
| 303 | system, "BUG()"s were not, which has been corrected. |
| 304 | (merge 0a9dde4a04 jt/trace2-BUG later to maint). |
| 305 | |
| 306 | * "git grep --untracked" is meant to be "let's ALSO find in these |
| 307 | files on the filesystem" when looking for matches in the working |
| 308 | tree files, and does not make any sense if the primary search is |
| 309 | done against the index, or the tree objects. The "--cached" and |
| 310 | "--untracked" options have been marked as mutually incompatible. |
| 311 | (merge 0c5d83b248 mt/grep-cached-untracked later to maint). |
| 312 | |
| 313 | * Fix "git fsck --name-objects" which apparently has not been used by |
| 314 | anybody who is motivated enough to report breakage. |
| 315 | (merge e89f89361c js/fsck-name-objects-fix later to maint). |
| 316 | |
| 317 | * Avoid individual tests in t5411 from getting affected by each other |
| 318 | by forcing them to use separate output files during the test. |
| 319 | (merge 822ee894f6 jx/t5411-unique-filenames later to maint). |
| 320 | |
| 321 | * Test to make sure "git rev-parse one-thing one-thing" gives |
| 322 | the same thing twice (when one-thing is --since=X). |
| 323 | (merge a5cdca4520 ew/rev-parse-since-test later to maint). |
| 324 | |
| 325 | * When certain features (e.g. grafts) used in the repository are |
| 326 | incompatible with the use of the commit-graph, we used to silently |
| 327 | turned commit-graph off; we now tell the user what we are doing. |
| 328 | (merge c85eec7fc3 js/commit-graph-warning later to maint). |
| 329 | |
| 330 | * Objects that lost references can be pruned away, even when they |
| 331 | have notes attached to it (and these notes will become dangling, |
| 332 | which in turn can be pruned with "git notes prune"). This has been |
| 333 | clarified in the documentation. |
| 334 | (merge fa9ab027ba mz/doc-notes-are-not-anchors later to maint). |
| 335 | |
| 336 | * The error codepath around the "--temp/--prefix" feature of "git |
| 337 | checkout-index" has been improved. |
| 338 | (merge 3f7ba60350 mt/checkout-index-corner-cases later to maint). |
| 339 | |
| 340 | * The "git maintenance register" command had trouble registering bare |
| 341 | repositories, which had been corrected. |
| 342 | |
| 343 | * A handful of multi-word configuration variable names in |
| 344 | documentation that are spelled in all lowercase have been corrected |
| 345 | to use the more canonical camelCase. |
| 346 | (merge 7dd0eaa39c dl/doc-config-camelcase later to maint). |
| 347 | |
| 348 | * "git push $there --delete ''" should have been diagnosed as an |
| 349 | error, but instead turned into a matching push, which has been |
| 350 | corrected. |
| 351 | (merge 20e416409f jc/push-delete-nothing later to maint). |
| 352 | |
| 353 | * Test script modernization. |
| 354 | (merge 488acf15df sv/t7001-modernize later to maint). |
| 355 | |
| 356 | * An under-allocation for the untracked cache data has been corrected. |
| 357 | (merge 6347d649bc jh/untracked-cache-fix later to maint). |
| 358 | |
| 359 | * Other code cleanup, docfix, build fix, etc. |
| 360 | (merge e3f5da7e60 sg/t7800-difftool-robustify later to maint). |
| 361 | (merge 9d336655ba js/doc-proto-v2-response-end later to maint). |
| 362 | (merge 1b5b8cf072 jc/maint-column-doc-typofix later to maint). |
| 363 | (merge 3a837b58e3 cw/pack-config-doc later to maint). |
| 364 | (merge 01168a9d89 ug/doc-commit-approxidate later to maint). |
| 365 | (merge b865734760 js/params-vs-args later to maint). |