Release of the distributed source control system Git 2.22

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

Compared to the previous release, 745 changes were accepted into the new version, prepared with the participation of 74 developers, of which 18 took part in the development for the first time. All innovations:

  • Available since release 1.18, the new commit rebase mode "git rebase --rebase-merges" replaces the old "--preserve-merges" option, which is now deprecated. The "git rebase" operation is used to replace a series of commits with a new base commit, for example, to move a separate branch that is developing some new feature to the current state of the master branch, which includes fixes added after the branch:

    o - o - o (my-feature)

    /

    o - o - o - o - o (master)

    o - o - o (my-feature)

    /

    o - o - o - o - o (master)

    To preserve the branch structure in a migrated branch, the “--preserve-merges” option could previously be used, which, when run in interactive mode (git rebase -i --preserve-merges), allowed editing the commit history, but did not guarantee complete preservation of the repository structure. The new “--rebase-merges” mode allows you to preserve the structure of changes in the branch being migrated, while providing a full range of interactive operations, including deleting, regrouping and renaming commits.

    For example, "--rebase-merges" Allows re-upload commits from a separate branch to a newer master branch, while maintaining the branch structure in the migrated branch, and make some changes to the commit notes on the fly.

  • Added support for creating a new branch based on the result of determining the merge base of two other branches (merge base, binding to a common ancestor) using the constructions “git branch new A...B” and “git checkout -b new A...B”, in which “A ...B" involves defining a merge base between two specified commits, similar to how "git checkout A...B" shifts the HEAD to the base commit and "diff A...B" shows the changes between commit "B" and the same as commit "A" "Ancestor.

    For example, when working on a separate my-feature branch, this feature can be used when you want to start from a different branch, for example, from the same place in the master branch from which the my-feature branch was checked out. Previously, this required manually examining the change log, which was inconvenient if you had a large history of changes, then running “git merge-base master my-feature” to calculate the hash of the merge base between the master and my-feature branches and creating a new branch relative to the common ancestor “ git branch my-other-feature hash." In Git 2.22, you can use the syntax "git branch my-other-feature A...B" to create a branch relative to the merge base of two other branches;

  • Added "git branch --show-current" option to display the name of the branch obtained during the checkout operation;
  • Added the “git checkout —no-overlay — dir” option, which allows, when performing a checkout operation, to bring the contents of the dir directory to a form that fully corresponds to the state of the master branch. For example, if there is a file in the local copy of the dir directory that is not in the master branch, then by default when executing “git checkout master - dir” it will be left, and if the “--no-overlay” option is specified, it will be deleted;
  • The "git diff" command uses a universal API for parsing options, which makes it possible to unify option handling with other git utilities. For example, in “git diff”, all options now have their antagonists (“--function-context” and “--no-function-context”);
  • Added the ability to filter extended tags attached to commits in the “git log” output (“trailer” - additional information flags, such as Signed-off-by and Co-authored-by). It is possible to filter labels by both key and value, for example:
    "git log --pretty="%(trailers:key=Reviewed-by,valueonly)";

  • A new tracing engine, Trace2, has been added, offering a more flexible and structured output format. Trace2 allows you to collect telemetry about executed operations and performance data for more detailed analysis and debugging (the handler is assigned by the user, no data is sent externally);
  • The “git bisect” report has been made more readable, in which problematic commits are now more clearly highlighted and summary statistics on changes for each file are displayed (at the level of the number of lines changed);
  • The heuristics for determining directory renamings have been reworked to eliminate false installation of renaming labels. When in doubt, such directories are now marked as conflicting;
  • A warning is displayed when you try to install a tag on another tag, which is usually done by mistake and can lead to setting the tag on the wrong commit (for example, a construction like “git tag -f -m “updated message” my-tag1 my- tag2″ will result in a tag being created on the old tag, whereas the developer expected the new tag to be installed on the commit pointed to by the old tag);
  • Generation is enabled for bitmap repositories (disk-based "reachability bitmaps" structure), which store data about sets of objects available for each commit and allow you to quickly determine the presence of a base object. This structure significantly reduces the execution time of data retrieval operations (git fetch).

Source: opennet.ru

Add a comment