Introduced release of a distributed source text management system Git 2.54. Git is known for its high performance and offers tools for nonlinear development based on branching and merging branches. To ensure the integrity of history and resilience to changes 'retroactively,' it uses implicit hashing of the entire previous history in each commit, as well as verification with digital signatures from developers for individual tags and commits. The Git code is distributed under license GPLv2+.
Compared to the previous release, the new version includes 770 changes prepared with the participation of 137 developers (66 of whom participated in Git development for the first time).
-
A command named 'git history' has been implemented, providing experimental capabilities for rewriting change history that are simpler and safer to use than rebasing commits with the git rebase command. Two operations are provided:
- git history reword for rewriting the message in the specified commit without changing the working directory and index (except for the note, everything else remains untouched). For example, to correct a typo.
- git history split for interactively splitting the specified commit into two different commits by moving selected parts from the original commit to an additional commit.
In upcoming releases, additional commands are expected to be added: git history fixup for correcting a commit, git history drop for deleting a commit, git history reorder for changing the order of commits, and git history squash for merging commits.
-
A new method for defining handlers (hook) in configuration files. Instead of placing scripts with handlers in the .git/hooks directory within each repository, commands for invoking handlers can now be specified directly in the configuration files. Settings can be linked to the repository or specified in configuration files that apply to all repositories (/etc/gitconfig) or user repositories (~/.gitconfig). It is possible to link multiple handlers to a single event. Scripts from .git/hooks are still called but are executed after handlers from configuration files. To view the list of handlers, the command git hook list should be used, and to selectively disable the invocation of handlers, the setting hook..enabled = false: should be applied.
[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
- In the command "git maintenance" the default strategy is set to geometric (git config set maintenance.strategy geometric), which helps reduce maintenance time for large monorepositories. Compared to the previously used strategy, which employs logic similar to the git gc command, the new strategy avoids repacking all objects and excludes excessively resource-intensive operations, such as merging all pack files (merging is done in parts when possible without cleaning up deleted objects).
- The object database (ODB) and its associated APIs have been transitioned to a new architecture based on the use of plug-in backends. The restructuring abstracts the object storage format and will enable features such as alternative backends and object formats, for more efficient storage of large binary files or for optimizing the work of large git hosting services.
- In the command "git repo structure", the output provides information about the repository structure, displaying not only the overall size but also showing the largest objects of each type, which allows size estimates without using third-party utilities. git-sizer.
$ 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 command "git replay», used instead of git rebase to recreate history on the server without working tree, atomic reference updates are enabled by default (instead of outputting a list of update-ref commands for manual execution), the —revert option has been implemented to undo changes from a series of commits, resulting empty commits are discarded, and the ability to recreate history up to the root commit has been introduced.
- In «git rev-list» and similar commands, the —maximal-only option has been added to show only commits that are unreachable by other commits.
- In the command «git repo info» the —keys option has been added to output a list of all known keys.
- In the command "git add -p» when navigating between code blocks using the 'J' and 'K' keys, already accepted and skipped blocks are marked. The —no-auto-advance option has been added to disable automatic transition to the next file, allowing you to return to previous files before committing.
- The web interface «gitweb» has been optimized for mobile devices.
- In the command "git apply –directory» ensures normalization of file paths, such as .\/un\/..\/normalized\/path, before use.
- Documented the possibility of adding custom subcommands by placing git-<cmd> files in the executable files directory.
- In the command «git send-email» has added support for client certificates.
- For the command «git status» the status.compareBranches configuration has been implemented, through which you can specify the branches to compare against the current branch:
[status] compareBranches = @{upstream} @{push}
- In «git rebase» the —trailer option has been added to simplify the addition of metadata to all commits:
git rebase —trailer "Reviewed-by: Test <test@example.com>"`
- In the command «git fast-import» has added the ability to replace signatures for commits that have become invalid after import.
- Support for packing (compaction) of multi-pack indices MIDX has been added, which combines small layers of the MIDX index with object availability information and related bitmap files, reducing the number of accumulated layers in long-standing repositories.
- The git backfill team has implemented the ability to specify revisions (commit ranges) and path masks (pathspec) to limit the parts of the change history being loaded:
git backfill main~100..main git backfill — ‘*.c’
- Alternative forms of the git config list command have been added – git config -l and git config —list.
- Non-ASCII characters are now allowed in command alias names defined in the configuration file:
[alias "get"] command = fetch
- The display of signatures that have expired GPG keys, but were valid at the time of signing the commit, has been changed. Such signatures are now shown as valid with a note about the key's expiration (previously they were highlighted in red, creating an impression of being invalid).
- When accessing repositories via HTTP, error handling for code 429 (Too Many Requests) has been implemented. Requests resulting in this error are now treated as temporary issues rather than fatal problems, for which the operation should be retried after a while. The delay before retrying is set via the http.retryAfter option, the number of retries is http.maxRetries, and the wait time is http.maxRetryTime.
Source: linux.org.ru
