macsAirI am excited to announce the release of Magit version 4.6, consisting of 313 commits since the last release half a year ago. The release notes can be found here.
Magit is a text-based Git user interface that puts an unmatched focus on streamlining workflows. Commands are invoked using short mnemonic key sequences that take the cursor’s position in the highly actionable interface into account to provide context-sensitive behavior.
With Magit you can do nearly everything that you can do when using Git on the command-line, but at greater speed and while taking advantage of advanced features that previously seemed too daunting to use on a daily basis. Many users will find that by using Magit they can become more effective Git user.
For more information about Magit, see https://magit.vc and these blog posts.
The primary focus of this release are blob-visiting buffers. For now the hope is that most users will find working with such buffers slightly more pleasant, without necessarily becoming aware that anything changed. The goal was to pay off technical debt and to prepare for future changes.
Visiting blobs now always involves magit-find-file-noselect, even
when an existing buffer may be involved. The behavior of this
function is getting closer to that of find-file-noselect.
Implemented support for visiting blobs for the benefit of features such as syntax-highlighting, as opposed to the user visiting it explicitly. Such “volatile” blob buffers are hidden and are cached for a while, in case they are needed again. If the user visits a hidden cached blob, the buffer is renamed to reveal it, and it is no longer subject to garbage collection.
Blobs can now alternatively be visited with nothing but a blob object id (instead of a revision and a path).
Blob-visiting buffers can now be reverted with g, which is useful
when the buffer is visited via, e.g., a branch, as opposed to a
revision or blob object id. The buffer is not needlessly refreshed,
if the blob oid does not change.
Improved support for jumping to the same location in another blob, from a buffer visiting a blob or file.
Syntax highlighting can now be enabled for diffs. This is disabled by default, because the work is still being performed synchronously, which leads to noticeable delays for large diffs and can be sluggish even for smaller diffs.
A future release is going to add support for asynchronous diff syntax highlighting. (The blob buffer cache added in this release does help, but is not enough.)
Configure magit-diff-fontify-hunk to try out this feature now, but
please just disable it again, if it turns out to still be too slow
for your taste. If you enable this, you should also customize the
new option magit-diff-specify-hunk-foreground and possibly the new
option magit-diff-use-indicator-faces as well.
The new Git variables hook.NAME.event and hook.NAME.command are now
used to call Elisp hooks from Git hooks.
After waiting for such functionality for two decades, I came to the conclusion that this will never be implemented, and finally added a noisy kludge to get the same functionality anyway, in the previous release. Of course, just one release later, Git added the missing functionality 😝. We now use Git’s variables, which means that Elisp hooks can now only be called from Git hooks when using Git v2.54.0 or greater.
Added support for compiling a list of definitions that are modified
in a diff, and for inserting such lists when authoring commit
messages. The new commands git-commit-insert-changelog-gnu and
git-commit-insert-changelog-plain insert such list and can be
invoked from the same menu (on C-c C-i), which is used to insert
commit trailers.
When authoring commit messages, complete-symbol now completes
against modified definitions and symbols appearing in modified
lines.