Hi,% username%, today, great news: in the public domain appeared release distributed control system version 2.29.0 the Git . Probably, on Habré it is not worth telling what it is, because Git is still one of the best systems.
The new release contains 627 changes at once, which were made by 89 developers. We talk about the main changes and improvements under the cut.
- SHA-256 SHA-1 . Git . . , SHA-1 , Git . SHA3-256, SHA2-256, SHA2 Git . , , . , , - — .
- Now Git has added the ability to include a new object format when creating a repository:
$ git init --object-format=sha256 repo
Initialized empty Git repository in /home/ttaylorr/repo/.git/
$ cd repo
$ echo 'Hello, SHA-256!' >README.md
$ git add README.md
$ git commit -m "README.md: initial commit"
[master (root-commit) 6e92961] README.md: initial commit
1 file changed, 1 insertion(+)
create mode 100644 README.md
$ git rev-parse HEAD
6e929619da9d82c78dd854dfe237c61cbad9e95148c1849b1f96ada5ee800810
You can only choose between SHA-1 and SHA-256, there is no possibility to combine different hashes in one repository.
- The git fetch and git push commands now support exclusionary link specifications that extend the rules for matching links between branches in local and external repositories. This feature will be useful in situations where you need to not only select, but also exclude some branches from the mapping. So, when you need to check out all the "refs / heads / *" branches, except for one "refs / heads / ref-to-exclude", before you had to specify the full list using this script:
$ git ls-remote origin 'refs/heads/*' |
grep -v ref-to-exclude |
awk '{ print $2:$2 }' |
xargs git fetch origin
- Now there is an exception operator "^". Expressions with this operator accept templates, but cannot refer to object identifiers. A command using the new operator might look like this:
$ git fetch origin 'refs/heads/*:refs/heads/*' ^refs/heads/ref-to-exclude
In addition, you can use exclusions in the settings:
$ git config --add remote.origin.fetch ^refs/heads/foo
- The "git shortlog" now has the ability to group commits by the content of additional fields, "Reviewed-by:" and "Coauthored-by:", not just by author or committer. So if you need to display a list of the most actively reviewing developers, then you need a command:
$ git shortlog -ns --group=trailer:reviewed-by v2.28.0.. | head -n5
40 Eric Sunshine
10 Taylor Blau
4 brian m. carlson
2 Elijah Newren
1 Jeff King
- Multiple --group statements can be specified at startup and use the --format option. So to keep track of co-authors or contributors, you now need to specify the following:
$ git shortlog -ns --group=author --group=trailer:co-authored-by
$ git shortlog --format="...helped %an on %as" --group=trailer:helped-by v2.28.0..v2.29.0
- If a conflict occurs during a git merge operation, the header of the commit message is now bracketed to explicitly separate the data from the commit from the Git diagnostic messages.
- The developers brought back the second version of the Git communication protocol, which was disabled in the 2.27 release. Thus, a bug that led to stability problems has been fixed.
- The "--first-parent" option has been added to the git bisect command, which is used to detect a revision, to change the selection of commits between the known working revision and the revision in which the problem occurred.
You can view all the innovations here .