Git project released Git 2.19 earlier this week (September 10th, 2018).
Git 2.19 brings more Python 3 compatibility work for git p4, a rewritten git submodule now implemented in C. Git Instaweb works better with newer versions of Apache. It also has a git range-diff feature, new capabilities in git grep, branch sorting changes, and a variety of other additions.
Features in Git 2.19
A new ‘git range-diff’ tool
Developers previously used the git rebase to rewrite history and polish their commits before making them public. git diff shows the difference between the two end states, but it doesn’t provide information about any of the individual commits.
This version includes git range-diff, a tool for comparing two sequences of commits, including changes to their order, commit messages, and the actual content changes they introduce.
Improvements in ‘git grep’
In Git 2.19 you can now locate the first matching column of your query with git grep –column.
git grep also learned the new –only-matching option. This is useful if you have a non-trivial regular expression and want to gather only the matching parts of your search.
A new ‘auto’ option
The content-transfer-encoding of the message “git send-email” sends out by default was 8bit, which can cause trouble when there is an overlong line to bust RFC 5322/2822 limit. A new option ‘auto’ to automatically switch to quoted-printable when there is such a line in the payload has been introduced and is made the default.
The branch.sort option and other sorting options
The git branch command, like git tag (and their scriptable counterpart, git for-each-ref), takes a –sort option to let you order the results by a number of properties. To show branches in the order of most recent update, you could use git branch –sort=-authordate. However, if you always prefer that order, typing that sort option can get tiresome.
This version introduces the branch.sort config to set the default ordering of git branch. By default, git branch sorts by refname, hence master is first and newest is last.
The other sorting options include:
- –sort=numparent shows the best merges.
- –sort=refname sorts branches alphabetically by their name.
- –sort=upstream sorts branches by the remote from which they originate.
Other improvements in Git 2.19
- ‘git submodule foreach’ has been largely rewritten in C.
- ‘git diff –color-moved’ feature has further improvised.
- The userdiff pattern for .php has been updated.
- ‘git instaweb’ has been adjusted to run better with newer Apache on RedHat based distros.
- Preparatory code to later add json output for telemetry data has been added.
Read the complete updates and improvements in the Git 2.19 release notes.
Read Next
Microsoft announces Azure DevOps, makes Azure pipelines available on GitHub Marketplace
Packt’s GitHub portal hits 2,000 repositories
GitHub parts ways with JQuery, adopts Vanilla JS for its frontend