Release of the distributed source control system Git 2.26

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

  • Changed by default to second version Git communication protocol, which is used when a client connects remotely to a Git server. The second version of the protocol is notable for providing the ability to filter branches and tags on the server side, returning a shortened list of links to the client. Previously, any pull command always sent the client the full list of references in the entire repository, even when the client only updated one branch or checked that its copy of the repository was up to date. Another notable innovation is the ability to add new features to the protocol as new functionality becomes available in the toolkit. The client code remains compatible with the old protocol and can continue to work with both new and old servers, automatically falling back to the first version if the server does not support the second.
  • The "-show-scope" option has been added to the "git config" command to make it easier to identify the place where certain settings are defined. Git allows you to define settings in different places: in the repository (.git/info/config), in the user directory (~/.gitconfig), in the system-wide configuration file (/etc/gitconfig), and through command line options and environment variables. When doing "git config" it's quite hard to figure out exactly where the desired setting is defined. The "--show-origin" option was available to solve this problem, but it only shows the path to the file in which the setting is defined, which is useful if you intend to edit the file, but does not help if you want to change the value through "git config" using options "--system", "--global", or "--local". The new "--show-scope" option displays the context of variable definitions and can be used in conjunction with "--show-origin":

    $ git --list --show-scope --show-origin
    global file:/home/user/.gitconfig diff.interhunkcontext=1
    global file:/home/user/.gitconfig push.default=current
    […] local file:.git/config branch.master.remote=origin
    local file:.git/config branch.master.merge=refs/heads/master

    $ git config --show-scope --get-regexp 'diff.*'
    global diff.statgraphwidth 35
    local diff.colormoved plain

    $ git config --global --unset diff.statgraphwidth

  • In binding settings credentials URL masks allowed. Any HTTP settings and credentials in Git can be set both for all connections (http.extraHeader, credential.helper) and for URL-bound connections (credential.https://example.com.helper, credential.https: //example.com.helper). Until now, wildcards such as *.example.com were only allowed for HTTP settings, not for credential binding. In Git 2.26, these differences are fixed and, for example, to bind a username to all subdomains, you can now specify:

    [credential "https://*.example.com"]

    username=ttaylorr

  • Continued expansion of experimental support for partial clones, which allows you to transfer only part of the data and work with an incomplete copy of the repository. The new release adds a new "git sparse-checkout add" command, which allows you to add individual directories to apply the "checkout" operation to only part of the working tree, instead of listing all such directories at once through the command "git sparse-checkout set" (can be added by one directory, without re-setting the entire list each time).
    For example, to clone a git/git repository without committing blobs, restricting the checkout to only the root of the working copy, and separately tagging to check out the "t" and "Documentation" directories, you could use:

    $ git clone --filter=blob:none --sparse [email protected]:git/git.git

    $ cd git
    $ git sparse-checkout init --cone

    $ git sparse-checkout add t
    ....
    $ git sparse-checkout add Documentation
    ....
    $ git sparse-checkout list
    Documentation
    t

  • The performance of the "git grep" command, which is used to search both the current contents of the repository and historical revisions, has been significantly improved. Scanning the contents of the working tree using multiple threads ("git grep --threads") was allowed to speed up searches, but searches in historical revisions were single-threaded. Now this limitation has been removed due to the implementation of the possibility of parallelizing read operations from the object storage. By default, the number of threads is set equal to the number of CPU cores, which in most cases does not require explicit setting of the "--threads" option now.
  • Added support for autocomplete input of subcommands, paths, links and other arguments of the "git worktree" command, which allows you to work with multiple working copies of the repository.
  • Added support for bright colors that have ANSI escape sequences. For example, in the highlight color settings "git config --color" or "git diff --color-moved" you can specify "%C(brightblue)" via the "--format" option for bright blue.
  • Added a new version of the script fsmonitor-watchman, providing integration with the mechanism Facebook Watchman to speed up tracking of file changes and new files. After updating git is required substitute hook in the repository.
  • Added optimizations to speed up partial clones operations related to the use of bitmaps
    (bitmap machinery) to avoid exhaustive enumeration of all objects during recoil filtering. Checking for blobs (-filter=blob:none and --filter=blob:limit=n) is now performed during partial cloning
    substantially faster. GitHub has announced patches with these optimizations and experimental support for partial cloning.

  • The 'git rebase' command has been moved to a different backend that uses the 'merge' mechanism by default (previously used for 'rebase -i') instead of 'patch+apply'. In some small things, the backends differ, for example, after continuing the operation after resolving the conflict (git rebase --continue), the new backend offers to edit the commit message, while the old one simply used the old message. To return the old behavior, you can use the '--apply' option or set the 'rebase.backend' configuration variable to 'apply'.
  • An example of a handler for authentication parameters set via .netrc has been changed to a form that can be used out of the box.
  • Added setting gpg.minTrustLevel to set the minimum trust level for various elements that perform digital signature verification.
  • Added "--pathspec-from-file" option to "git rm" and "git stash".
  • Test suites continued to be improved in preparation for the transition to the SHA-2 hashing algorithm instead of SHA-1.

Source: opennet.ru

Add a comment