The release of the distributed version control system Git 2.55 has been announced. Key changes include the default inclusion of Rust-based builds, the implementation of the fsmonitor process for Linux, a new strategy for repacking incremental MIDX indices, the `git history fixup` command to fix commits, optimization of object availability bitmap generation, support for parallel execution of hooks, and the `git format-rev` command. The Git code is distributed under the GPLv2+ license.
Compared to the previous release, 505 changes have been accepted in this new version, prepared with the participation of 100 developers, 33 of whom contributed to Git for the first time. Major innovations include (1, 2, 3):
- Support for components written in Rust is enabled by default. The rustc compiler
has been added to the build dependencies. To build without Rust, you can use the flag `NO_RUST=1` when running the make utility or `-Drust=disabled` when executing `meson configure`. The ability to disable Rust-based builds will be supported until Git version 3.0, where Rust will be included as a mandatory dependency. A Rust implementation has been developed for portability between configurations using SHA-1 and SHA-256 hashes, as well as some internal functions such as encoding and decoding variable-length integer values. In the future, a more substantial rework of internal Git components in Rust is expected. - The experimental `git history` command, which provides options for rewriting change history, has added the `git history fixup` operation to fix commits. The `fixup` operation allows changes added via `git add` to be moved to an earlier commit and automatically rewrite all subsequent commits similar to performing `git commit --fixup=` and running `git rebase --autosquash ~`.
- A background fsmonitor process has been implemented for the Linux platform, tracking changes in the file system using the inotify mechanism and allowing you to avoid scanning the entire working directory when executing commands such as `git status`. Activation is done through the `core.fsmonitor` setting.
- The command "git repack" has been enhanced with the mode "--write-midx=incremental", implementing a new strategy for updating metadata in the incremental MIDX index (multi-pack index), allowing for the avoidance of repacking the entire index. In the incremental multi-pack index, instead of a single large index containing information about the distribution of objects across pack files, a layer separation is used—each layer covers a specific number of pack files and is stored in a separate bitmap file. This structure allows for adding object data from new pack files to the index, appending new layers to the index without reconstructing the existing layers.
The command "git repack --write-midx=incremental" enables the addition of a new layer to the incremental MIDX index, covering recently created pack files. In combination with the repository packing mode "--geometric", the new command allows for merging new objects from multiple pack files into a larger pack file and, if necessary, packing and merging several adjacent layers of the incremental MIDX index. This strategy allows for rewriting only the top layers during "git repack", leaving the old large layers untouched, while also preventing uncontrolled growth of the layer chain, maintaining the total number of layers at a level proportional to the logarithm of the total number of objects.
- The generation of object availability bitmaps has been significantly optimized through a new algorithm for traversing the object tree, eliminating unnecessary recursion, caching object positions, sorting bitmaps before merging them with the XOR operation, and reworking the code for creating pseudo-merge bitmaps. In a test repository, these optimizations have reduced the bitmap generation time from 612 to 294 seconds.
- The ability to run independent hooks in configuration files in parallel has been implemented. Hooks that affect shared state or take it into account, such as those that change commit notes or inspect the index and working tree, cannot be run in parallel. However, hooks for linting and unit testing can be run simultaneously. Hooks that allow parallel execution are configured through the parameter 'hook.hook_name.parallel = true'. The number of jobs running simultaneously is determined by the hook.jobs setting, hook..jobs, or the command-line option '-j'.
- In the command 'git pack-objects --path-walk', the ability to specify filters such as 'blob:none', 'blob:limit=', 'tree:0', 'object:type=', 'sparse:', and 'combine:' has been implemented. In a conducted test, discarding blobs during '--path-walk' reduced the size of the created pack file by 16%.
- The command 'git format-rev' has been added for formatting revisions and object names mentioned in commit lists or appearing in arbitrary text (for example, it can be used in hooks for processing commit notes).
git last-modified | git format-rev --stdin-mode=text --format=%an
Junio C Hamano builtin/commit.c
- By default, the escaping of most terminal control sequences in informational messages and error texts being passed is enabled. proxy server. When accessing malicious server such escape sequences could be used to obscure or modify the output, for example, through escape sequences for cursor movement and text clearing. Support for escape sequences for highlighting elements in color is retained.
- The command 'git checkout -m' now automatically saves conflicting local changes in the stash area without the need to immediately resolve the conflict.
- The command 'git push' has added the ability to push a branch to multiple external Git servers in one command. For example, to push the main branch not only to the primary server but also to mirrors, a group 'publish' can be created from servers 'github', 'gitlab', and 'mirror':
git config remotes.publish 'github gitlab mirror'
git push publish main - The command "git log --graph" has been updated with the option "--graph-lane-limit=" to limit the number of vertical lanes when visualizing branches, allowing room on the screen for commit data in repositories with many branches.
…
* | | | | 619931f561 Merge branch 'dl/posix-unused-warning-clang'
|\ \ \ \ \
| * | | | ~ cf48887610 compat/posix.h: simplify GIT_GNUC_PREREQ() comparison
| * | | | ~ ffd45926dc compat/posix.h: clean up GIT_GNUC_PREREQ() and UNUSED
|\ \ \ \ \~
| * | | | ~ 3f5203eeb4 ls-files: filter pathspec before lstat - The commands "git log" and "git rev-list" have been updated with the option "--max-count-oldest=", allowing you to select the N oldest commits in the range.
Source: opennet.ru
