The Git 2.41 source code management system is available.

After three months of development, the release of the distributed version control system Git 2.41 has been published. Git is one of the most popular, reliable, and high-performance version control systems, offering flexible means for non-linear development based on branching and merging. To ensure the integrity of history and resilience against backdating changes, implicit hashing of all previous history is used in each commit, and digital signatures for developers can also authenticate certain tags and commits.

Compared to the previous release, this new version includes 542 changes made by 95 developers, 29 of whom participated in the development for the first time. Key innovations:

  • Improved handling of unreachable objects, which do not have references in the repository (no branches or tags point to them). Unreachable objects are removed by the garbage collector, but they remain in the repository for a certain period before deletion to avoid race conditions. To track the period during which unreachable objects exist, it is necessary to tag them with modification timestamps, which prevents storing them in a single pack file where all objects share the same modification time. Previously, each unreachable object was stored in a separate file, leading to issues when many recent unreachable objects that had not yet been subject to deletion were present. In the new release, the 'cruft packs' mechanism is used by default for packaging unreachable objects, allowing all unreachable objects to be stored in a single pack file, while their modification timestamps are reflected in a separate table, stored in a file with the '.mtimes' extension and linked through an index file with the '.idx' extension.
    The Git 2.41 source code management system is available.
  • By default, disk-based reverse index (revindex) tracking for pack files is enabled. Testing on the torvalds/linux repository showed that using the reverse index sped up resource-intensive 'git push' operations by 1.49 times, while simple operations, such as calculating the size of a single object using 'git cat-file --batch='%(objectsize:disk)'', improved 77 times. Files ('.rev') with the reverse index will be saved inside the repository in the '.git/objects/pack' directory.

    Recall that Git stores all data in the form of objects, which are placed in separate files. To increase efficiency when working with the repository, objects are additionally placed in pack files, where information is presented as a stream of objects following one another (a similar format is used when transferring objects with the git fetch and git push commands). For each pack file, an index file (.idx) is created, allowing rapid identification of the offset in the pack file for a given object's identifier.

    The newly included reverse index aims to optimize the process of identifying an object’s ID based on the object’s location information in the pack file. Previously, such transformation was performed on-the-fly during the parsing of the pack file and was stored only in memory, which prevented the reuse of these indexes and necessitated regenerating the index each time. The index-building operation consists of creating an array of 'object-position' pairs and sorting it by position, which can be time-consuming for large pack files.

    For example, the operation of outputting the contents of objects using the direct index was 62 times faster than the operation of showing the sizes of objects, for which position-to-object data was not indexed. After using the reverse index, these operations took about the same time. Reverse indexes also allow for speeding up object transmission operations when executing fetch and push commands by directly transferring already prepared data from the disk.

    The Git 2.41 source code management system is available.
  • Support for passing WWW-Authenticate headers between the credential helper and the service performing the authentication has been added to the 'credential helper' protocol used for passing credentials when accessing repositories with restricted access. Support for the WWW-Authenticate header allows the transmission of OAuth scope parameters for more granular control over user access to repositories and delimiting areas available for requests.
  • The command for-each-ref has been enhanced with a formatting option «%(ahead-behind:)», allowing you to obtain information about the number of commits that are either present or absent in a specific branch compared to another branch (how much one branch is behind or ahead of another in terms of commits). Previously, to get such information, it was necessary to run two separate commands: «git rev-list —count main..my-feature» to get the number of unique commits for the branch and «git rev-list —count my-feature..main» to get the number of missing commits. Now, such calculations can be reduced to a single command, simplifying the script writing and reducing execution time. For example, to show unmerged branches and assess their lag or lead relative to the main branch, you can use a one-liner: $ git for-each-ref —no-merged=origin/HEAD \ —format='%(refname:short) %(ahead-behind:origin/HEAD)' \ refs/heads/tb/ | column -t tb/cruft-extra-tips 2 96 tb/for-each-ref—exclude 16 96 tb/roaring-bitmaps 47 3 instead of the previously used script that runs 17 times slower: $ git for-each-ref —format='%(refname:short)' —no-merged=origin/HEAD \ refs/heads/tb | while read ref do ahead='$(git rev-list —count origin/HEAD..$ref)' behind='$(git rev-list —count $ref..origin/HEAD)' printf '%s %d %d\n' '$ref' '$ahead' '$behind' done | column -t tb/cruft-extra-tips 2 96 tb/for-each-ref—exclude 16 96 tb/roaring-bitmaps 47 3
  • The command «git fetch» has been enhanced with the option «—porcelain», which, when specified, produces output in the format « », which is less human-readable but more convenient for parsing in scripts.
  • A new setting «fetch.hideRefs» has been added, which speeds up «git fetch» operations by hiding some references in the local repository during the verification phase when the server sends the complete set of objects, thereby saving time by limiting the check to servers, from which data is extracted directly. For example, during a test on a system with repositories containing a large number of tracked external references, excluding all references except those directed to the target server $remote, reduced the execution time of the «git fetch» operation from 20 minutes to 30 seconds. $ git -c fetch.hideRefs=refs -c fetch.hideRefs=!refs/remotes/$remote \ fetch $remote
  • The command «git fsck» now includes the ability to check for corruption, checksum compliance, and the correctness of values in the availability and reverse index bitmaps.
  • The command 'git clone —local' now outputs an error when attempting to copy from a repository containing symbolic links within $GIT_DIR.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster