
Introduced release of a distributed source text management system Git 2.55Among the key changes: inclusion of the Rust build by default, implementation of the fsmonitor process for Linux, a new strategy for repackaging the incremental MIDX index, the git history fixup command for fixing commits, optimization of object availability bitmap generation, support for parallel execution of hooks, the git format-rev command. Git Code is distributed under license GPLv2+.
Compared to the previous release, the new version includes 505 changes prepared with the participation of 100 developers, 33 of whom participated in the development of Git for the first time.
Main innovations (github.blog, gitlab.com/blog, gitlab.com/git-scm):
- the net/http enabled support for components in the Rust language. Compiler rustc implemented among the build dependencies. To build without Rust, you can use the NO_RUST=1 flag when running the make utility or -Drust=disabled when executing meson configure. The ability to disable the Rust build will be supported until Git 3.0, in which Rust will be included among the mandatory dependencies. A layer for portability between configurations with SHA-1 and SHA-256 hashes has been implemented in Rust, as well as some internal functions such as encoding and decoding variable-length integer values. In the future, a rework of more significant internal components of Git in Rust is expected.
- In the experimental command "git history", which provides capabilities for rewriting change history, the operation ‘git history fixup’ has been added to fix commits. The fixup operation allows moving changes added via git add to an earlier commit and automatically rewriting all subsequent commits similar to executing the command git commit —fixup=<commit> and running git rebase —autosquash <commit>~.
- For the Linux platform, a background process fsmonitor, monitors changes in the file system using the inotify mechanism, and allows avoiding a complete scan of the working directory when executing commands like git status. Activation is done through the setting “core.fsmonitor».
- The git repack command has added the --write-midx=incremental mode, which implements 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 layered structure is used — each layer covers a specific number of pack files and is stored in a separate bitmap file. This structure allows the addition of object data from new pack files to the index by attaching new layers to the index without restructuring the existing layers. The git repack --write-midx=incremental command allows you to add a new layer to the incremental MIDX index covering recently created pack files. Combined with the repository packing mode --geometric, this new command enables the merging of new objects from several pack files into one larger pack file and, if necessary, perform packing and merging of several adjacent layers of the incremental MIDX index. This strategy allows you to rewrite only the top layers during git repack, leaving the older larger layers untouched, as well as 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.
- Significant optimization has been made in the generation of object availability bitmaps due to a new algorithm for traversing the object tree that eliminates unnecessary recursion, caches object positions, sorts bitmaps before combining them with the XOR operation, and has reworked the code for creating pseudo-merge bitmaps (pseudo-merge). In a test repository, the optimizations allowed for a reduction in bitmap generation time from 612 to 294 seconds.
- The ability to execute independent processes in parallel has been implemented. . In general, Airflow hooks are the connection points to external services and libraries. For example, in configuration files. Hooks that affect or consider shared state, such as changing commit messages or inspecting indices and the working tree, cannot run in parallel. However, hooks for linting checks and unit testing can be executed simultaneously. Hooks that allow parallel execution are configured using the parameter hook.hook_name.parallel = true. The number of jobs launched simultaneously is determined by the settings hook.jobs, hook..jobs, or the command-line option -j.
- In the git pack-objects command —path-walk, the ability to specify filters such as blob:none, blob:limit=, tree:0, object:type=, sparse:, and combine: is implemented. In the conducted test, omitting blobs while executing —path-walk allowed for a 16% reduction in the size of the generated pack file.
- The git format-rev command has been added for formatting revisions and object names mentioned in commit lists or found in arbitrary text (for example, it can be used in hooks to process commit messages).
git last-modified | git format-rev --stdin-mode=text --format=%an
Junio C Hamano builtin/commit.c
- By default, the majority of terminal control sequences in informational messages and error text sent by the server are escaped. When interacting with a malicious server, such escape sequences could be used to hide or modify output, for example, through escape sequences for cursor movement and text clearing. Support for escape sequences to highlight elements with color is retained.
- The git checkout -m command now automatically saves conflicting local changes in the stash area without needing to resolve the conflict immediately.
- The git push command has been enhanced to allow pushing a branch to multiple external Git servers with a single command. For instance, to push the main branch not only to the primary server but also to mirrors, you can create a publish group from the servers github, gitlab, and mirror:
git config remotes.publish "github gitlab mirror"
git push publish main
- The git log —graph command has been enhanced with the —graph-lane-limit= option to limit the number of vertical lanes when visualizing branches, allowing space on the screen for commit data in repositories with a large number of 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 git log and git rev-list commands have been enhanced with the —max-count-oldest= option, allowing the selection of the N oldest commits in the range.
Source: linux.org.ru
