Release of the distributed source control system Git 2.24

Available release of the distributed source control system Go to 2.24.0. 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, 544 changes were accepted into the new version, prepared with the participation of 78 developers, of which 21 took part in the development for the first time. All innovations:

  • Added support for configuration macros, through which you can quickly switch between different sets of settings without going into the details of the specific options associated with them. With the help of macros, there is no need to remember which settings you need to change to activate a particular functionality. For example, in case of slowdown with a large repository, you may need to switch to a new indexing mechanism, enable path prefix compression, and enable the cache of untracked files by setting index.version to 4 and enabling core.untrackedCache. Macros allow you not to waste time looking for the right solution in the documentation, but immediately activate settings with optimizations for repositories with a large number of files:

    git config feature.manyFiles true

  • By default, storage of objects in the form of a commit-graph is enabled, in which not a linear list of hashes of objects with links to other objects is used for indexing, but a structure in the form of a graph. If earlier, to determine the releases that contain a certain fix, it was required to load each object from disk to search for links, then when stored as a graph, you can immediately determine all the necessary links. The transfer to storage in the form of a graph of commits in the repositories of the Linux kernel and Git made it possible to achieve an almost twofold increase in the performance of operations with branches. To activate the new storage method after upgrading to Git 2.24, run the "git gc" command.

    Of the changes associated with the commit-graph, there is also a reduction to a single form of implementation of the operation progress indicator in the commit-graph-related commands ("git commit-graph write", "git commit-graph verify", etc.) .). The progress indicator is now displayed by default only for the terminal (to change the behavior, use the "-[no-]progress" option). In addition, a new configuration parameter fetch.writeCommitGraph has been added, which enables automatic updating of the file with the commit graph during β€œgit fetch” operations (all commits retrieved from external repositories will immediately fall into the commit-graph without the need to run auto-gc separately);

  • Added a command to overwrite the history of changes - "git filter repo", which is a simpler alternative to the command "git filter-branchΒ» to perform operations on the history of changes in the repository (for example, deleting a file from the repository or retrieving the change history of a specific directory). To improve efficiency, instead of the ordered per-commit parsing in "git filter-repo", operations are performed on the history representation in the form of a continuous stream.

    History is filtered using the "-path-{glob,regex}" option, which allows you to use both simple masks and regular expressions. There are also options to perform a "find and replace" operation or to purge binary objects that are larger than a given size. Each rewritten commit is provided with a new SHA-1 hash identifier, and all references to the replaced commit are updated with the new identifier.

    To display a summary with statistics about the repository (the number of objects by type, the largest files and directories, which extensions require more disk space, etc.), the "-analyze" option is provided. To expand the functionality, it is possible to connect arbitrary callback handlers in the Python language, through which you can both create new subcommands and process various events (for example, new types of files);

  • Added "--end-of-options" option to separate options from link names that can start with "-" character and be treated as options ("git log --end-of-options --super-dangerous-option"). If in everyday life such names can be escaped as β€œgit log 'refs/heads/β€”super-dangerous-option'”, then scripts could have problems with determining the namespace. The common delimiter '-' does not apply in this case, as it is already used to separate link names from files (e.g. "git log --end-of-options --super-dangerous-option ^master --path/to/file");
  • Added "--strategy" and "--strategy-option" options to "git rebase --rebase-merges" for selection merger strategies;
  • Added a new handler ".git/hooks/pre-merge-commit", called after the merge is done, but before the resulting commit is written;
  • Support for completing configuration variables in relation to the settings of specific commands has been added to the command autocompletion engine.
    For example, if you need to type "git -c core.autocrlf=false add path/to/my/file" but don't remember the exact name of the "core.autocrlf" variable, you can press Tab and get a hint.

Also, Git developers added a code of conduct for a project participant that defines the basic principles for resolving conflict situations. The document is based on the recommendationsContributor Covenantused by many open source projects, including the Linux kernel, Eclipse, Freedesktop, GitLab, Ruby, and Kubernetes. The document defines equal opportunities for all participants, regardless of their worldview, age, gender, religious preferences, level of education, social status and nationality. The community welcomes a friendly form of communication, understanding, empathy for the problems of other participants, the perception of constructive criticism, making the best decisions for the entire community. Trolling, abusive communication, humiliation, harassment, privacy violations, disclosure of personal information, as well as other actions that may be considered inappropriate in professional communication are not allowed.

Source: opennet.ru

Add a comment