The Git 2.55 release of the distributed source control system has been announced. Key changes include: the inclusion of Rust builds by default, implementation for Linux fsmonitor process, a new strategy for repackaging the incremental MIDX index, the "git history fixup" command for fixing a commit, optimization of object availability bitmap generation, support for parallel hook execution, and the "git format-rev" command. Git is licensed under the GPLv2+ license.
Compared to the previous release, the new version includes 505 changes prepared with the help of 100 developers, 33 of whom were new to Git development. Key new features (1, 2, 3):
- Rust language component support is enabled by default. The rustc compiler
Rust has been added to the build dependencies. To build without Rust, you can use the "NO_RUST=1" flag when running the make utility or "-Drust=disabled" when running "meson configure." The ability to disable building with Rust will be supported until Git 3.0, which will include Rust as a required dependency. Rust implements a layer for portability between SHA-1 and SHA-256 hash configurations, as well as some internal functions, such as encoding and decoding variable-length integers. More significant Git internals are expected to be rewritten in Rust in the future. - The experimental "git history" command, which provides the ability to rewrite the history of changes, has been updated with the "git history fixup" operation for fixing a commit. The "fixup" operation allows you to move changes added via "git add" to an earlier commit and automatically rewrite all subsequent commits, similar to running the "git commit --fixup=" command. " and running "git rebase --autosquash ~».
- For platform Linux The fsmonitor background process has been implemented, which monitors changes in the file system using the inotify mechanism and allows you to avoid traversing the entire working directory when executing commands such as "git status". It can be enabled through the "core.fsmonitor" setting.
- The "git repack" command has been updated with the "--write-midx=incremental" option. This option implements a new strategy for updating metadata in the incremental MIDX index (multi-pack index), eliminating the need to repack the entire index. The incremental multi-pack index uses layers instead of a single large index containing information about the distribution of objects across packfiles. Each layer covers a specific number of packfiles and is stored in a separate bitmap file. This structure allows data about objects in new packfiles to be added to the index, attaching new layers to the index without rebuilding existing layers.
The "git repack --write-midx=incremental" command adds a new layer to the incremental MIDX index, encompassing recently created packfiles. When combined with the "--geometric" repository packing mode, the new command enables combining new objects from multiple packfiles into a single larger packfile and, if necessary, packing and merging multiple adjacent layers of the incremental MIDX index. This strategy allows "git repack" to rewrite only the upper layers, leaving older, larger layers intact. It also prevents uncontrolled growth of the layer chain by maintaining the total number of layers proportional to the logarithm of the total number of objects.
- The generation of object availability bitmaps has been significantly optimized through a new object tree traversal algorithm that eliminates unnecessary recursion, caching of object positions, sorting of bitmaps before combining them with the XOR operation, and reworking the code for creating pseudo-merge bitmaps. In the test repository, these optimizations reduced the bitmap generation time from 612 to 294 seconds.
- Parallel execution of independent hooks is now possible in configuration files. Hooks that affect or take into account shared state, such as those that change commit notes or inspect indexes and the working tree, cannot be run in parallel. However, hooks for linter checking and unit testing can be run in parallel. Hooks that allow parallel execution are configured using the "hook.hook_name.parallel = true" parameter. The number of jobs that can be run simultaneously is determined by the hook.jobs, hook setting. .jobs or the "-j" command line option.
- The "git pack-objects --path-walk" command now allows you to specify filters such as "blob:none", "blob:limit= ", "tree:0", "object:type= », «sparse: " and "combine:". In the test, discarding blobs when executing "--path-walk" reduced the size of the generated pack file by 16%.
- Added the "git format-rev" command for formatting revisions and object names mentioned in commit lists or found in arbitrary text (for example, this 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
- Escape of most terminal control sequences in information messages and error text transmitted is enabled by default. serverWhen accessing malicious server Such escape sequences could be used to hide or modify output, for example, through escape sequences for cursor movement and clearing text. Support for escape sequences for highlighting elements has been retained.
- The git checkout -m command now automatically saves conflicting local changes to the stash area without requiring you to immediately resolve the conflict.
- The "git push" command now allows you to push a branch to multiple external Git servers with a single command. For example, to push the main branch not only to the main server but also to mirrors, you can create a "publish" group from servers "github", "gitlab" and "mirror":
git config remotes.publish "github gitlab mirror"
git push publish main - The "git log --graph" command now has the "--graph-lane-limit=" option. » to limit the number of vertical bars when visualizing branches, which allows you to leave 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 now have the "--max-count-oldest=" option. , which allows you to select the N oldest commits in a range.
Source: opennet.ru
