Release of distributed version control system Git 2.31

The release of the distributed version control system Git 2.31 is now available. 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 against 'backdating' changes, implicit hashing of the entire previous history is utilized in every commit. It is also possible to verify individual tags and commits digitally signed by developers.

Compared to the previous release, the new version includes 679 changes, prepared with the participation of 85 developers, of which 23 participated in the development for the first time. Key innovations include:

  • The new command 'git maintenance' has been added, allowing periodic tasks to be performed on systems that do not support cron. For example, with this new command, a periodic execution of the repository packing process can be organized, so you do not have to wait for the repository lock to finish during automatic packing while executing various commands. The 'git maintenance' command allows for optimizations and maintenance operations to be performed in the background, without blocking the interactive session — once an hour, it performs proactive loading of fresh objects from the remote repository and updates the commit graph file, while the repository packing process runs every night.
  • Support for maintaining a reverse index (revindex) on disk for pack files has been added. Recall that Git stores all data in the form of objects that are placed in separate files. To improve efficiency when working with the repository, objects are additionally placed in pack files, where information is represented in the form of a stream of objects following one another (a similar format is used when transferring objects with git fetch and git push commands). An index file (.idx) is created for each pack file, allowing for very quick determination of the offset in the pack file by the object's identifier. The proposed reverse index (.rev) in Git 2.31 aims to optimize the process of identifying an object's identifier based on information about the object's placement in the pack file.

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

    For example, the operation of outputting object contents, which uses direct indexing, was 62 times faster than the operation that shows object sizes, for which the data linking position to object was not indexed. After using the reverse index, these operations now take roughly the same amount of time. Reverse indices also speed up object sending operations when executing fetch and push commands by directly transferring already prepared data from disk. By default, reverse indices are not created; to enable their generation, the 'git config pack.writeReverseIndex true' setting must be turned on, followed by packing the repository with the 'git repack -Ad' command.

  • Performance optimizations have been added based on the introduction of the commit-graph file format, which is used to optimize access to commit information, as well as new data about commit generation numbers that can be used to accelerate additional operations with commits.
  • The ability to override the default main branch name used in new repositories (init.defaultBranch setting) has been enhanced. When accessing external repositories, git tries to retrieve the branch that HEAD points to, i.e., if the external server repository uses 'main' as the default branch, then the 'git clone' operation will attempt to locally fetch 'main'. In Git 2.31, support for such fetching is now also implemented for empty repositories. For example, when locally cloning a new repository before adding the first patches to it, the local copy will now contain the external server default branch name.
  • The 'git rev-list' command has been enhanced with the '--disk-usage' option, allowing for an overview of object sizes.
  • In anticipation of the upcoming backend replacement for merge operations, rename detection has been significantly optimized.
  • Support for the outdated PCRE1 regular expression library has been discontinued.
  • The ability to enforce the prohibition of shortened links, effective regardless of the hashing algorithm, has been provided. The prohibition is enabled by setting the core.abbrev parameter to 'no'.
  • A new option ‘—path-format=(absolute|relative)’ has been added to the ‘git rev-parse’ command to explicitly determine the output of relative or absolute paths.
  • Scripts for auto-completing input in Bash have simplified the addition of completion rules for custom git subcommands.
  • A new option ‘—stdin’ has been added to the ‘git bundle’ command to read references from standard input.
  • A new option ‘—diff-merges=’ has been added to the ‘git log’ command.
  • A new option ‘—deduplicatecan’ has been added to the ‘git ls-files’ command to eliminate duplicates in output.
  • New masks for excluding a range of commits have been added — ‘^!’ and ‘^-’.
  • Options ‘—left-only’ and ‘—right-only’ have been added to the ‘git range-diff’ command to show only one side of the compared range.
  • Options ‘—skip-to=’ and ‘—rotate-to=’ have been added to the ‘git diff’ and ‘git log’ commands to skip or move to the end of initial paths.
  • An option ‘—skip-to=’ has been added to the ‘git difftool’ command to resume an interrupted session from an arbitrary path.
  • The Code of Conduct, defining the main principles for resolving conflicts between developers, has been updated to version 2.0 (previously version 1.4 was used).

    Source: opennet.ru
Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster