BREAKING CHANGE: This removes git-gutter as an implementation for the
`:ui vc-gutter` module, leaving only the diff-hl implementation. There
are no longer any +git-gutter or +diff-hl flags for this module. Users
don't have to do anything to keep the vc gutter, unless they prefer
git-gutter for any reason (in which case they'll need to install and set
it up themselves).
This has been planned for some time, because of a roadmap goal for Doom
to lean into native/built-in functionality where it's equal or better
than the third party alternatives. diff-hl relies on the built-in vc.el
library instead of talking to git directly (thus expanding support to
whatever VCS's vc.el supports, and not git alone), which also means it
can take advantage of its caching and other user configuration for
vc.el. Overall, it is faster and lighter.
What I've also been waiting for was a stage-hunk command, similar to
git-gutter:stage-hunk, which arrived in dgutov/diff-hl@a0560551cd and
dgutov/diff-hl@133538973b, and have evolved since.
Ref: dgutov/diff-hl@a0560551cd
Ref: dgutov/diff-hl@133538973b
Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=58747789
Changes +magit/quit to behave more like canonical
magit-mode-bury-buffer, but after burying/killing the last magit buffer
for the current repo, kill all the other buried ones too.
Also binds Q in magit to kill all magit buffers for the current repo.
This fixes the behavior of e.g. magit-diff-show-or-scroll-down.
When in magit-log-mode, said action should not move focus to the diff
window because it would otherwise behave identical to pressing
magit-show-commit.
When a log or diff buffer is opened from the magit status buffer, it
would display them in a random window (or split, if none were
available). This changes forces it to predictably open to the right of
the magit status window (using the next window over, if available).
Magit complains loudly (but harmlessly) when it can't determine its own
version in a sparse clone. This was fixed upstream in
magit/magit@b1b2683 for unix OSes, but not for Windows where symlinks
aren't supported, and so `magit-version` can't resolve its own repo's
root (see raxod502/straight.el#520).
The former no longer works, since ghub's API has changed. Meanwhile, the
magit-clone command has grown in features to match (and surpass)
+magit/clone, so we'll just use that instead.
Some packages that depend on org (like elfeed) will load the built-in
org early in the rebuild/package install process, which causes org to
define org-release and org-git-version, sometimes overwriting our stubs
for it. Without our hack, org call 'git describe' in the org repo in an
attempt to determine the installed version, which won't work in a sparse
clone. To ensure future definitions never overwrite ours, we advise them
as well.
Also moves magit-version hack to its autoload file, for consistency with
org's hacks.
The former default display function would strive to open windows below
the current magit window (splitting it), but this would stack and
quickly become cramped. The behavior is now to reuse the same
window *unless* you're opening the process buffer or from the commit
window.
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:
1. Replace the bar | to indicate a hook function with a -h suffix, e.g.
doom|init-ui -> doom-init-ui-h
doom|run-local-var-hooks -> doom-run-local-var-hooks-h
2. And add a -fn suffix for functions meant to be set on variables,
e.g.
(setq magit-display-buffer-function #'+magit-display-buffer-fn)
See ccf327f8 for the reasoning behind these changes.
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
magit-clone function has changed signature to work with transient.
So using the new magit-clone-regular instead.
Signed-off-by: Huy Duong <huy.duong@employmenthero.com>
If you accidentally open multiple magit status windows, you'll be stuck
in a deadlock, where `q` will do nothing. Now, +magit/quit will use
`quit-window` on excess magit-status windows instead.
Instead of magit-post-refresh-hook, which fires much more frequently.
Updating vc across all buffers is expensive, so let's only do it when we
quit magit.
Warning: this may make quitting magit expensive when you have many
buffers open. Still searching for a better solution.
Full column is a bit tempermental. This also removes the need to restore
the window config after quitting magit.
Why the switch from full-frame magit to current-buffer? It is the least
intrusive policy; it doesn't rearrange the user's workspace.
The old policy was to invoke magit in fullscreen, but in practice, I've
found myself wanting to peek at other buffers (maybe even notes) while I
manage my project in version control.
So this change introduces two big changes and one fix:
+ Instead of a full-frame policy, we use full-column. e.g. Invoking
magit-status will take up a full column of windows (and will restore
them when you quit).
+ Popups are displayed below the current window if called from a magit
buffer, otherwise as a popup at the bottom of the frame.
+ Fixes popups opening in a random window if called from a magit buffer
in a popup.
This is only a start and needs more testing.