Git 2.37 source control release

The release of the distributed source control system Git 2.37 is introduced. Git is one of the most popular, reliable, and high-performance version control systems that provides flexible non-linear development tools based on branching and merging branches. To ensure the integrity of the history and resistance to retroactive changes, implicit hashing of the entire previous history in each commit is used, it is also possible to verify individual tags and commits with digital signatures from the developers.

Compared to the previous release, 395 changes were accepted into the new version, prepared with the participation of 75 developers, of which 20 took part in the development for the first time. Main innovations:

  • The mechanism of partial indexes (sparse index), covering only part of the repository, has been brought ready for widespread use. Partial indexes can improve performance and save space in repositories that perform partial cloning (sparse-checkout) operations or work with an incomplete copy of the repository. The new release completes the integration of partial indexes into the git show, git sparse-checkout, and git stash commands. The most noticeable performance benefit from using partial indexes is seen with the git stash command, which has seen an 80% increase in execution speed in some situations.
  • A new “cruft packs” mechanism has been implemented for packing unreachable objects that are not referenced in the repository (not referenced by branches or tags). Unreachable objects are deleted by the garbage collector, but remain in the repository for a certain time before they are deleted to avoid race conditions. To track the period of occurrence of unreachable objects, it is necessary to attach tags to them with the time of change of similar objects, which does not allow storing them in one pack file in which all objects have a common change time. Previously, saving each object in a separate file led to problems when there were a large number of fresh, unreachable objects that were not yet eligible for deletion. The proposed “cruft packs” mechanism allows you to store all unreachable objects in one pack file, and reflect data on the modification time of each object in a separate table stored in a file with the “.mtimes” extension.
  • For Windows and macOS, there is a built-in mechanism for tracking changes to the file system, allowing you to avoid iterating over the entire working directory when performing operations such as “git status”. Previously, to track changes, external utilities for tracking changes in the FS, such as Watchman, could be connected via hooks, but this required the installation of additional programs and configuration. Now the specified functionality is built-in and can be enabled with the command “git config core.fsmonitor true”.
  • In the “git sparse-checkout” command, support for an alternative to the “—cone” mode, the method of defining templates for partial cloning, has been declared obsolete, which allows, when determining the part of the repository that is subject to the cloning operation, to list individual files using the “.gitignore” syntax, which does not allow use for optimization partial indexes.
  • Increased flexibility in configuring the fsync() call to flush changes to disk. Support for the “batch” synchronization strategy has been added to the “core.fsyncMethod” parameter, which allows speeding up work when writing a large number of individual files by accumulating changes in the writeback cache, which is reset by a single fsync() call. The test, which resulted in 500 files being added using the “git add” command, was completed in 0.15 seconds when the new mode was enabled, while calling fsync() took 1.88 seconds for each file, and without using fsync - 0.06 seconds .
  • Branch traversal commands like “git log” and “git rev-list” now have an option “-since-as-filter=X” that allows you to filter out information about commits that are older than “X”. Unlike the “—since” option, the new command is implemented as a filter that does not stop the search after the first commit older than the specified time.
  • In the “git remote” command, when specifying the “-v” flag, information about partial clones of the repository is displayed.
  • Added "transfer.credentialsInUrl" setting, which can take the values ​​"warn", "die" and "allow". If specified in the parameter “remote. .url" plaintext credentials, attempting to perform a "fetch" or "push" operation will fail with an error if the "transfer.credentialsInUrl" setting is set to "die", or a warning if set to "warn".
  • By default, the new implementation of the interactive mode of the “git add -i” command, rewritten from Perl to C, is enabled.

Source: opennet.ru

Add a comment