Git 2.54, a distributed source code management system, is released. Git boasts high performance and provides non-linear development capabilities based on branching and merging. To ensure historical integrity and resilience to retroactive changes, it uses implicit hashing of the entire previous history in each commit, as well as digital signatures of individual tags and commits. Git is licensed under the GPLv2+ license.
Compared to the previous release, the new version includes 770 changes, contributed by 137 developers (66 of whom were new to Git development). Key new features include:
- The "git history" command has been implemented, providing experimental capabilities for rewriting commit history, which are easier and safer to use than rebasing commits with "git rebase." Two operations are provided:
- git history reword " to rewrite the message in the specified commit without changing the working tree or index (except for the note, the rest remains untouched). For example, to fix a typo.
- git history split » to interactively split the specified commit into two different commits, moving the selected parts from the original commit to the additional commit.
Future releases will include additional commands: "git history fixup" to fix a commit, "git history drop" to remove a commit, "git history reorder" to change the order of commits, and "git history squash" to squash commits.
- A new method for defining hooks in configuration files has been implemented. Instead of placing scripts with hooks in the ".git/hooks" directory in each repository, commands for invoking hooks can now be specified directly in configuration files. Settings can be linked to a repository or specified in configuration files that apply to all repositories (/etc/gitconfig) or user repositories (~/.gitconfig). Multiple hooks can be bound to a single event. Scripts from ".git/hooks" will still be called, but they are run after hooks from configuration files. To view the list of hooks, use the "git hook list" command, and to selectively disable hook invocation, use the "hook" setting. .enabled = false." [hook "linter"] event = pre-commit command = ~/bin/linter --cpp20 [hook "no-leaks"] event = pre-commit command = ~/bin/leak-detector $ git hook list pre-commit global linter ~/bin/linter --cpp20 local no-leaks ~/bin/leak-detector
- The "git maintenance" command uses the "geometric" strategy by default ("git config set maintenance.strategy geometric"), which reduces maintenance time for large monorepositories. Compared to the previously used strategy, which used logic similar to "git gc," the new strategy avoids repackaging all objects and eliminates resource-intensive operations such as merging all packfiles (where possible, merging is done in parts and without purging deleted objects).
- The Object Database (ODB) and its associated APIs have been migrated to a new architecture based on pluggable backends. This restructuring abstracts the object storage format and will enable the implementation of features such as alternative backends and object formats, for example, for more efficient storage of large binary files or for optimizing the performance of large Git hosting services.
- The "git repo structure" command, which displays information about the repository structure, displays not only the total size, but also the largest objects of each type, allowing you to estimate the size without using the third-party git-sizer utility. $ git repo structure … | * Largest objects | | | * Commits | | | * Maximum size [1] | 17.23 KiB | | * Maximum parents [2] | 10 | | * Trees | | | * Maximum size [3] | 58.85 KiB | | * Maximum entries [4] | 1.18 k | | * Blobs | | | * Maximum size [5] | 1019.51 KiB | | * Tags | | | * Maximum size [6] | 7.13 KiB |
- In the "git replay" command, used instead of "git rebase" to recreate history on server without a working tree, atomic ref updates are enabled by default (instead of listing update-ref commands to execute manually), the "--revert" option is implemented for undoing changes from a series of commits, resulting empty commits are discarded, and the ability to reconstruct history back to the root commit is introduced.
- Added "--maximal-only" option to "git rev-list" and similar commands to show only commits that are not reachable by other commits.
- The "git repo info" command now has a "--keys" option to list all known keys.
- When navigating between code blocks using the "J" and "K" keys in the "git add -p" command, already approved and skipped blocks are now marked. The "--no-auto-advance" option has been added to disable automatic advancement to the next file, allowing you to revisit previous files before committing.
- The "gitweb" web interface has been optimized for use on mobile devices.
- The "git apply --directory" command ensures that file paths are normalized before use, such as "./un/../normalized/path".
- The ability to add custom subcommands by placing "git-" files is documented. » in the directory with executable files.
- Support for client certificates has been added to the 'git send-email' command.
- The "git status" command now has a "status.compareBranches" setting, which allows you to specify branches to compare the current branch with. [status] compareBranches = @{upstream} @{push}
- The "--trailer" option has been added to git rebase to make it easier to add metadata to all commits. git rebase --trailer "Reviewed-by: Test »
- The 'git fast-import' command now has the ability to replace signatures for commits that become invalid after import.
- Added support for multi-pack index (MIDX) compaction, which combines small MIDX index layers containing object availability information and associated bitmaps, reducing the number of accumulated layers in long-standing repositories.
- The "git backfill" command now supports specifying revisions (commit ranges) and path masks (pathspecs) to limit the parts of the change history that are downloaded. git backfill main~100..main git backfill — '*.c'
- Added alternative forms for calling the "git config list" command: "git config -l" and "git config --list".
- Allow non-ASCII characters in command alias names specified in the configuration file. [alias "get"] command = fetch
- The display of signatures whose GPG keys have expired but were valid at the time the commit was signed has been changed. These signatures are now displayed as valid with a note about the key expiration (previously, they were highlighted in red, giving the impression that they were invalid).
- When accessing repositories via HTTP, error code 429 (Too Many Requests) is now handled correctly. Requests that fail with this error are no longer treated as fatal, but as temporary errors for which the operation should be retried after a certain amount of time. The retry delay is set using the "http.retryAfter" option, the number of retries is "http.maxRetries," and the timeout is "http.maxRetryTime."
Source: opennet.ru
