A few days ago it was announced Release of the new version of the Git 2.50 project, introducing more than 600 changes driven by an active community that this time included 98 developers, including 35 new contributors.
This new version of Git 2.50 is highlighted by the integration of new commands (git-diff-pairs), new functions for cleaning, filtering, and maintenance, the replacement of the recursive merge engine with ORT, as well as performance improvements and bug fixes.
Git 2.50 Key New Features
In this new version of Git 2.50, one of the most important new features is the optimization in the treatment of so-called "cruft packs", That is, packages of objects that are inaccessible or not referenced by branches or tags. Traditionally, Git stored these objects in a single, large package file, which could cause performance issues when repackaging repositories with many of these items.
With the new version, Git allows you to split these cruft packs into several smaller files, which reduces disk usage and improves input/output performance for bulk operations. In addition, sand enter the option –combine-cruft-below-sizeWhich enables combine small packages into one more flexibly than the previous –max-cruft-size option, without imposing a limit on the combined file size. This new feature is especially useful in projects with orphaned objects spread across multiple packages.
Another improvement aimed at large-scale repositories is the experimental support for the incremental update of MIDX indices , which They store information about objects in separate layers using bitmap files, which allows for faster updates as new commits are added. This advancement is critical for large repositories that require rapid indexing operations without having to completely rebuild metadata.
Complete replacement of the recursive merge engine with ORT
Git 2.50 introduces a major change with the permanent removal of the recursive fusion engine traditional. Instead, the use of ORT is consolidated, more modern, maintainable and efficient fusion engine. ORT not only offers more precise conflict analysis, but also allows you to verify whether a merge is possible without generating additional objects. Furthermore, the merge-tree command now includes a –quiet option for use as a silent merge checker without modifying the repository.
gitt-diff-pairs: the solution to scalability problems
Code review is undoubtedly one of the pillars of modern collaborative development, and differences or diffs between revisions play an important role in this process. With the arrival of Git 2.50, a solution designed for scalability has been introduced: the new git-diff-pairs command.
Traditionally, to get a comparison between two revisions you use a command like:
git diff HEAD~1 HEAD
This generates a complete patch containing all changes between the listed revisions. While effective in many cases, it can be a performance issue when dealing with large sets of modified files.
That's why git-diff-pairs was specifically designed to receive raw input directly from the output of git diff-tree, and generate the corresponding patches efficiently and accurately.
The use is as simple as:
git diff-tree -r -z -M HEAD~ HEAD | git diff-pairs -z
This command takes the provided blob pairs and generates the exact diff output, preserving contextual information and allowing work to be split into smaller batches. This opens the door to parallel processing, improves resource efficiency, and facilitates scalability in diff-based tools like GitLab.
New features for cleaning, filtering and maintenance
Git 2.50 includes several additional tools designed to improve repository maintenance:
- The command has been added git reflog drop, which allows you to completely delete the reflog for a specific branch, ideal for cleaning up your work history when you no longer need to maintain previous references.
- The option –Filter cat-file –batch is now available in git, allowing you to filter results by object type.
In addition, several internal optimizations are also highlighted:
- Improved use of symbolic links, with prefix caching and reduction of redundant checks.
- Removal of Perl dependencies in documentation and test scripts, replacing them with shell functions or C implementations, making them easier to compile on systems with minimalist configurations.
- Including a controller userdiff for analysis of differences in .ini files.
- Improved compatibility of the git send-email command with SMTP servers such as Outlook.
Finally, if you are interested in knowing more about it, you can consult the details in the following link