I am excited to announce the release of Magit version 2.12, consisting of 610 commits since the last feature release six month 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.
As mentioned in the latest update I have concentrated on addressing as many “small” issues and feature requests as possible. With halve the year over already I have to concentrate on the big refactorings now. See the release milestones to learn when I intend to implement which features.
Please also see the release notes. They begin with a list of upcoming breaking changes.
I am going to take care of the stickers over the next two weeks.
This release adds many new commands: magit-blame-reverse
,
magit-branch-checkout
, magit-branch-or-checkout
,
magit-branch-pull-request
, magit-branch-shelve
,
magit-branch-unshelve
, magit-browse-pull-request
,
magit-checkout-pull-request
, magit-cherry-donate
,
magit-cherry-harvest
, magit-cherry-spinoff
,
magit-cherry-spinout
, magit-commit-reshelve
,
magit-diff-unmerged
, magit-diff-visit-file-other-window
,
magit-dired-log
, magit-merge-absorb
, magit-merge-into
,
magit-merge-squash
, magit-next-line
, magit-patch-apply-popup
,
magit-patch-apply
, magit-patch-save
, magit-previous-line
,
magit-rebase-remove-commit
, magit-remote-prune-refspec
,
magit-remote-prune
, magit-reshelve-since
,
magit-stash-branch-here
, magit-worktree-popup
and magit
.
Among these I think the following are most noteworthy:
The commands magit-checkout-pull-request
and
magit-branch-pull-request
(on b y and b Y) read a
pull request in the minibuffer and then create a local branch for
that. That branch is properly configured, including the upstream
and push-remote. This makes it a breeze to review pull requests
directly in Magit. For more information see the Ghub
announcement.
After performing a merge the commands magit-merge-into
and
magit-merge-absorb
(on m i and m a) also delete the
merged branch. If the branch was created using one of the
pull-request commands mentioned above, then they also offer to
delete the respective remote. The existing, and more generic,
magit-branch-delete
command learned to do that too.
Moving commits between branches can now be done in one step using
the commands magit-cherry-donate
, magit-cherry-harvest
,
magit-cherry-spinout
and magit-cherry-spinoff
. They are
available from the cherry popup on A. These commands are
similar to the existing magit-branch-spinoff
, which learned to
move only a single commit to a new branch.
It is now possible to blame in reverse using the new command
magit-blame-reverse
, which is available from the blame popup when
that makes sense.
Most module commands now default to act on the selected modules or if no modules are selected the current module, if any. Otherwise they fall back to read a single module from the user. Previously some of these commands acted on all modules and it was not possible to perform the respective actions on a subset of modules. Acting on all suitable modules is still possible using a prefix argument. Many arguments have been added to the module popup.
Note that the terminology about modules as used by Git is ambiguous
and that Magit now departs from that. Magit avoids the term
“initialized” and instead uses the term “populated” to refer to a
module whose working directory exists. The names of commands have
been adjusted accordingly. For example, unlike git submodule
init
, which does not actually “initialize” a module,
magit-submodule-popuplate
does “populate” a module (using git
submodule update --init
).
When the dispatch popup is invoked in non-Magit buffers, then certain actions that cannot be used there are no longer shown. On the other hand some actions that can only be used in file-visiting buffers are now shown when this popup is invoked from such a buffer.
Worktree commands are now available from a new popup on %.
This is probably a good time to remind you that you can view the documentation for a popup action directly from the popup. From a popup, if x would invoke a command, then ? x shows its documentation instead. This also works for arguments; use e.g. ? - x instead of - x. By the way, locating the documentation like this has been improved a lot in this release. Also if you don’t know about C-t yet, then check that out too.
The commands magit-remote-remove
and magit-branch-delete
now
unset the relevant push-remote related variables, which Git fails to
do, unlike for other variable affected by the removal of a remote or
branch. Likewise the command magit-remote-rename
now renames such
variables.
Depending on the value of the new magit-branch-rename-push-target
option the command magit-branch-rename
may now also preserve the
local branch’s push-remote or even rename the push branch on the
remote. The default is to do both.
The most important change regarding many existing and new commands
probably is the addition of the new magit-dwim-selection
option.
Disagreements about whether certain commands should act on the thing
at point (with or without confirmation) or only use that as the
default while letting the user choose something else instead has been
a source of frustration for a long time. This new option hopefully
puts an end to that. Please see the documentation
for more information.
The documentation regarding completion, confirmation, the selection, and the hunk-internal region was significantly extended. It might be worth reading that even if you have done so before because this release makes some big changes here, including:
For a long time Magit has supported selecting two or more sibling sections using the region and then acting on that selection instead of only on the current section. Single-section selections were not supported and a region that did not span multiple siblings was not visualized as a selection. Now that is supported.
Not every section-aware command was adjusted to take single-section selections into account because in many cases that would have led to undesired changes in behavior.
When there is a valid selection based on the region, then the region itself was never visualized. Now it is, but only if it stays within a single line.
The section visibility is now being cached for all sections.
Previously this was only done for some sections. When a section
disappeared and later appeared again, then it went back to its
initial visibility. The option magit-section-cache-visibility
can
be used to restrict the cache to certain sections again
The section visibility cache can now also remember that a section should be expanded instead of being hidden when the latter is the default and the section reappears. Previously only the opposite was possible.
For magit-status-mode
and magit-refs-mode
buffers the visibility
cache now persists when killing the buffer.
This release also adds many new options and features, and fixes many bugs. I am particularly happy that the backlog is almost gone now.
The release notes list many changes not mentioned above.
Comments on Reddit.