Release of the distributed source control system Git 2.31

The Git 2.31 release of the distributed source control system is available. 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, 679 changes were accepted into the new version, prepared with the participation of 85 developers, of which 23 took part in the development for the first time. Main innovations:

  • Added "git maintenance" command to allow periodic maintenance on systems that do not support cron. For example, using a new command, you can organize the periodic launch of the repository packaging process so that you do not have to wait for the repository lock to complete when packaging is automatically performed while running various commands. The β€œgit maintenance” command allows you to perform optimizations and operations to maintain the optimal structure of the repository in the background without blocking the interactive session - once an hour, work is done to prefetch fresh objects from the remote repository and update the file with the commit graph, and every night the process of packing the repository is started .
  • Added support for maintaining a reverse index (revindex) on disk for pack files. Recall that Git stores all data in the form of objects, which are placed in separate files. To increase the efficiency of working with the repository, objects are additionally placed in pack files, in which information is presented in the form of a stream of objects following one after another (a similar format is used when transferring objects with the git fetch and git push commands). An index file (.idx) is created for each pack file, which allows you to very quickly determine the offset in the pack file by which the given object is stored by the object identifier. The reverse index (.rev) proposed in Git 2.31 aims to streamline the process of determining an object's ID from information about the location of an object in a pack file.

    Previously, such conversion was performed on the fly during the parsing of the pack file and was stored only in memory, which did not allow reuse of such indexes and forced the index to be generated each time. The operation of building an index is reduced to building an array of object-position pairs and sorting it by position, which can take a long time for large pack files.

    For example, the operation of displaying the contents of objects, which uses a direct index, was 62 times faster than the operation of showing the size of objects, for which the position-to-object relationship data was not indexed. After using the reverse index, these operations began to take approximately the same time. Reverse indexes also allow you to speed up the operation of sending objects when executing fetch and push commands by directly transferring ready-made data from disk. Reverse indexes are not created by default, and generating them requires enabling the "git config pack.writeReverseIndex true" setting, followed by packaging the repository with the "git repack -Ad" command.

  • Added performance optimizations based on the introduction of new commit generation number data in the commit-graph file format used to optimize access to commit information, which can be used to speed up additional commit operations.
  • Added the ability to override the name of the main branch used by default in new repositories (setting init.defaultBranch). When accessing external repositories, git tries to checkout the branch pointed to by HEAD, i.e. if the external server defaults to the "main" branch, then the "git clone" operation will attempt to fetch "main" locally. Git 2.31 now supports this checkout for empty repositories. For example, when cloning a new repository locally before adding the first patches to it, the local copy will now contain the default upstream name exposed on the external server.
  • Added "--disk-usage" option to "git rev-list" command to display a summary of object sizes.
  • In anticipation of the upcoming replacement of the backend for performing merges, the detection of renames has been significantly optimized.
  • Support for the legacy regular expression library PCRE1 has been dropped.
  • Provided the ability to force the use of shortened links, acting regardless of the hashing algorithm. The ban is enabled by assigning the value "no" to the core.abbrev parameter.
  • Added "--path-format=(absolute|relative)" option to "git rev-parse" command to explicitly specify output of relative or absolute paths.
  • Bash input completion scripts make it easier to add completion rules for native "git" subcommands.
  • Added "--stdin" option to "git bundle" command to read links from standard input.
  • Added new option to "git log" command "--diff-merges= ".
  • Added "--deduplicatecan" option to "git ls-files" command to eliminate duplicate output.
  • Added new masks to exclude a range of commits - " ^!" And " ^- ".
  • Added "--left-only" and "--right-only" options to "git range-diff" command to show only one side of the range being compared.
  • --skip-to= options added to "git diff" and "git log" commands " and "--rotate-to= ' to skip or move to the end of initial paths.
  • Added "--skip-to=" option to "git difftool" command ' to resume an interrupted session from an arbitrary path.
  • The Code of Conduct (Code-of-conduct), which defines the basic principles for resolving conflict situations between developers, has been updated to version 2.0 (previously version 1.4 was used).

    Source: opennet.ru

Add a comment