After three months of development, the release of the distributed version control system Git 2.43 has been published. Git is one of the most popular, reliable, and high-performance version control systems, providing flexible means for nonlinear development based on branching and merging. To ensure the integrity of the history and resilience to 'backward' changes, implicit hashing of the entire previous history is utilized in each commit, and it is also possible to authenticate individual tags and commits with developers' digital signatures.
Compared to the previous release, the new version includes 464 changes made with the participation of 80 developers, 17 of whom contributed for the first time. The main innovations are:
- The 'git repack' command has been enhanced with the '--filter' and '--filter-to' options, allowing for the repacking of the repository considering a specified object filter, and if needed, moving objects that do not meet the filter criteria to a separate location. These options can be used to split the repository according to certain criteria (for example, to remove unnecessary or excessively large objects), while still allowing access to all parts through partial cloning. For instance, to retain blobs smaller than 1 MB in the repository and move the other large objects to a separate repository, you can execute: $ git init --bare ../backup.git $ git repack -ad --filter='blob:limit=1m' \ --filter-to=../backup.git/objects/pack/pack
Initializing the repository through partial cloning allows you to work with an incomplete copy of the repository, correctly handling requests for absent objects (when requesting absent objects, they will be loaded on-the-fly as needed).
- The ability to work with multiple pack files containing unreachable objects ("cruft packs"), for which there are no references in the repository (branches or tags do not point to them), has been added. With the new option "git repack --max-cruft-size", you can specify the maximum size of individual pack files and split the unreachable object database into a series of smaller pack files. Using several small pack files instead of one large file significantly reduces input/output operations when repacking repositories with many unreachable objects, as all data does not need to be rewritten for each repacking operation.
- Recognition of attempts to perform double commits via "git revert" has been added, and this is taken into account when generating the revert message (instead of "Revert: Revert: fix bug" for a repeated "git revert", it will now write "Reapply fix bug", and if the change is reverted a third time â "Revert Reapply fix bug"). $ git revert âno-edit HEAD > /dev/null $ git revert âno-edit HEAD > /dev/null $ git log âoneline a300922 (HEAD -> main) Reapply "fix bug" 0050730 Revert "fix bug" b290810 fix bug
- The usage of options "ârfc" and "âsubject-prefix" together is now allowed. For example, to format an email with the prefix "[RFC PATCH bpf-next]" in the message subject, you can specify: $ git format-patch âsubject-prefix="PATCH bpf-next" ârfc
- In the "git log" command, the placeholder "%(decorate)" can now be used to show the names of related branches when specifying the format using the "âformat" option, for example: $ git log âformat='%cr%(decorate) (%h) %s' 3 days ago (HEAD -> master, origin/master, origin/HEAD) (e0939bec27) RelNotes: minor wording fixes in 2.43.0 release notes 7 days ago (tag: v2.43.0-rc1) (dadef801b3) Git 2.43-rc1 7 days ago (8ed4eb7538) Merge branch 'tb/rev-list-unpacked-fix'
- The ability to apply .mailmap rules to format specifiers such as "%(authorname)" and "%(committeremail)" specified through the "âformat" option has been added to "git for-each-ref" and similar commands.
Source: opennet.ru
