Git 2.40 marks the first release of version control software this year. It provides the optional tool git jump
with Emacs support, simplifies the use of git check-attr
and continues to drive the migration of legacy Git assets from Perl and Shell to C.
Git jumps in Emacs and the elimination of a workaround
In 2018, Git 2.19 introduced the optional tool git jump
im contrib directory
a. It wraps other git commands like git grep
and adds their results to the Vim text editor’s quickfix list. This allows, for example git jump grep foo
Write and quickly navigate between all “foo” matches in Vim. With diff
and merge
let yourself git jump
also use. In Git 2.40, the tool learned to work with the text editor Emacs in addition to Vim.
Emacs users can git jump
try as follows:
M-x grepgit jump --stdout grep foo
There are also innovations for the command git check-attr
. It serves to determine which gitattributes
are set for a specific path. These can be broken down into one or more .gitattributes
-Define files in the repository. Previously needed git check-attr
an index such that in a Bare Repository a workaround for the temporary reading in the index was necessary:
TEMP_INDEX="$(mktemp ...)"
git read-tree --index-output="$TEMP_INDEX" HEAD
GIT_INDEX_FILE="$TEMP_INDEX" git check-attr ...
On the other hand can git check-attr
in Git 2.40 using the new --source=
after .gitattributes
to scan. This also applies to a bare repository:
$ git check-attr -a --source=HEAD^{tree} git.c
git.c: diff: cpp
git.c: whitespace: indent,trail,space
Git parts in C instead of Perl and Shell
The Git team has been working for a number of years to rewrite parts of Git that originally took the form of Perl or shell implementations as more modern C equivalents. In addition to being able to use Git’s own APIs natively, consolidating Git commands into a single process is said to result in accelerated execution of Git commands on platforms like Windows that have high process start-up costs.
The new release is now based on years of preparatory work git bisect
fully implemented in C as a native built-in. Besides that, the Git team has the legacy implementation git add –interactive
removed. First created as a shell script, it was re-introduced as a native built-in in Git 2.26, with which both the old and new flavors can be updated using the experimental configuration add.interactive.useBuiltin
let use. Since the value by default since version 2.37 at true
lag, the development team has now decided to finally remove the legacy variant.
These and other highlights in Git 2.40 illuminates a GitHub blog entry. All edits contributed by a total of 88 contributors can be found in the release notes.
(May)