Commit graph

294 commits

Author SHA1 Message Date
duianto b5fb7d5376 [base] Fix void spacemacs-evil-collection-allowed-list
problem
In the `spacemacs-base` distribution.

When the `git-enable-magit-todos-plugin`
layer variable is enabled.

Then the following message appears on startup:
>An error occurred while pre-configuring magit-todos in layer git (error: (void-variable spacemacs-evil-collection-allowed-list))

cause
The `spacemacs-evil-collection-allowed-list` variable
is assigned in the `git` layer.

But it's defined in the `spacemacs-evil` layer.

The `spacemacs-evil` layer isn't used by default
in the `spacemacs-base` distribution.

solution
Check that the `spacemacs-evil` layer is used
before adding to the variable.
2021-04-15 22:05:35 +02:00
emacspace 95a703b684 documentation formatting: Fri Apr 9 11:56:19 UTC 2021 2021-04-09 21:41:03 +02:00
Maximilian Wolff 9eac85fb6c [git] Add magit-todo to evil-collection configured packages
thanks goes to duianto for suggesting this move.
2021-04-08 20:46:39 +00:00
Lucius Hu dfb4c1c4cb git: Added magit-todos, improved docs, etc.
- Added `magit-todos` package, toggled by `git-enable-magit-todos-plugin`.
- Improved installation and loading of all magit-plugins:
  - All magit plugins are toggled by their corresponding layer variables
    PRE-INSTALLATION, instead of PRE-LOADING. That is, they are installed
    only when the toggle is non nil.
  - The `use-package` call is more specific now.
    - Hooks goes to `:hook`.
    - Removed `:defer` since it's implied by `:hook`, and it's actually not
      doing anything.
- Improved the documentation.
2021-04-08 20:41:24 +00:00
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
syl20bnr d55a9e2e67 Update header for year 2021 2021-03-25 22:59:32 -04:00
Ag Ibragimov 589c16b73a
git: adds orgit-forge so org links can be stored from forge topics (#14450)
* git: adds orgit-forge so org links can be stored from forge topics

* PR feedback

Suggested-by: Lucius Hu <lebensterben@users.noreply.github.com>
2021-03-14 00:26:38 +01:00
Ilya Grigoriev e8976832f8 Restore SPC gfd for magit-diff, set SPC gfm for magit-file-dispatch
Fixes https://github.com/syl20bnr/spacemacs/issues/14434
2021-02-28 20:55:53 +01:00
Ag Ibragimov e3434e8635 source-control: Change SPC gfd to magit-file-dispatch
SPC g f d  key should be more "contextual", allowing user to perform operations
associated with the current file
2021-02-23 14:43:17 +01:00
duianto b6aa0e651f [git] Remove unused evil-magit function
The only usage of the function: spacemacs//magit-evil-magit-bindings
was removed in the PR: [spacemacs-evil] add evil-collection #14200
2021-02-15 10:47:38 +01:00
duianto 3f7e69e0b1 [git][doc] Update magit bindings link
The evil-magit package has been deprecated and moved to:
https://github.com/emacs-evil/evil-collection/tree/master/modes/magit
2021-02-14 19:39:56 +01:00
duianto ec57b21a92 Fix which-key entries: gr and gs in dired and magit
problem:
pressing g shows the which-key entry:
r -> evil-mc

but it calls the expected commands:
revert-buffer (in dired)
magit-refresh

s -> evil-easymotion
but it calls the expected command:
magit-jump-to-staged

solution:
removing the gr and gs which-key entries,
shows the expected commands.
2021-01-30 11:59:18 +01:00
Thanh Vuong a6d364e0f2 [spacemacs-evil] add evil-collection
It is impossible to ignore `evil-collection` anymore. `evil-magit` has been
deprecated recently and moved to `evil-collection`.

It will save time and effort for both Spacemacs and Evil to share and contribute
to `evil-collection` imo.

However I strongly prefer Spacemacs binding scheme over evil-collection's one.
We should only pick what we need from `evil-collection`.

This PR add mechanism to embrace `evil-collection` and apply it to shell layer (`vterm`)
and git layer.
2021-01-30 01:11:07 +00:00
duianto 61ff12cbfc [base] Show a winum required message
problem:
key bindings that use the winum package,
don't work in the spacemacs-base distribution.

for example in the buffer transient state: SPC b .
{number}, C-{number} or M-{number}

shows messages like these:
Wrong type argument: commandp, winum-select-window-1
Symbol’s function definition is void: winum-get-window-by-number

cause:
the winum package is loaded in the spacemacs-navigation layer,
but the layer isn't used in the spacemacs-base distribution.

solution:
show the message:
This command requires the winum package,
winum is part of the spacemacs-navigation layer.
2021-01-09 08:40:32 +01:00
duianto 8839858d54 [git] Restore magit transient args between sessions
problem:
The Magit w (apply patches) arguments are not remembered between sessions.

cause:
Magit reads the transient files:
history.el, levels.el, and values.el
before Spacemacs has redirected them to the .cache directory.

solution:
Redirect the files before magit reads them.
2020-12-30 20:49:25 +01:00
duianto 62979df319 [git] Fix g magit-refresh for hybrid without evil navigation
This fixes g (magit-refresh), in the hybrid editing style when the variable:
hybrid-style-enable-evilified-state
is: nil

Thanks marienz for reporting the issue and for suggesting to check if the
editing style supports evil navigation.
https://github.com/syl20bnr/spacemacs/issues/14181#issuecomment-739251438
2020-12-06 16:44:49 +01:00
duianto 9c2a208b51 [git] Fix g for magit-refresh with emacs editing style
Fixes: <g> no longer works in Magit status screen #14181
2020-12-01 13:19:20 +01:00
Maximilian Wolff d69d2284f7 Fix undefined var during loading of magit 2020-11-28 07:41:05 +00:00
Maximilian Wolff be908875cb
Change newly added which-key bindings to use keymap api
The newly added bindings had side effects for
magit. This was caused by which-keys replacement
working on bindings which are identical between
various modes.

To fix this I have changed the api to use the newly
added keymap based replacements which avoid these
issues.

As a side effect they are a ton faster as which
key does not have to compare all available bindings
everytime it opens its help window.

I have also fixed some more missing which-key
description in magit status buffer.
2020-11-27 22:46:56 +01:00
emacspace c483818d7e documentation formatting: Sun Nov 22 08:56:33 UTC 2020 2020-11-24 22:22:17 +01:00
Maximilian Wolff 2298d8c141
Move remaining forge functions from github to git layer 2020-11-16 23:36:59 +01:00
Fabián Heredia Montiel b2cb7017e0
Move forge form github to git layer
Supports:
- Github (Both .com and enterprise on premises)
- Gitlab (Both .com and self-hosting)
- gogs / gitea
2020-11-16 23:36:59 +01:00
Maximilian Wolff 9c564b864f
[github] Make docs use pip instead of pip3
I have also added a note for users with distributions
still being on python2.
2020-11-14 09:28:46 +00:00
Daniel Nicolai 6c15706edf Add grip-mode to github layer 2020-11-14 09:47:36 +01:00
Keith Pinson e2718dd046
[git] Implement performance hack for MacOS from Magit Manual (#14070)
* [git] make finding of Git on MacOS more reliable per @tko
* [git] remove Darwin condition on finding git executable
2020-10-23 18:21:22 +02:00
Daniel Luna f266d0768a
Adding magit-delta option for magit 2020-09-27 14:21:50 +02:00
Ray 359b6f5466
Don't let magit-gitflow mode overwrite C-f key binding. (#13973)
* Don't let magit-gitflow mode overwrite `C-f` key binding.

* Describe changes in CHANGELOG.develop
2020-09-23 22:31:44 +02:00
Maximilian Wolff 25d6364bdb
[version control] Revise git-gutter+ refresh on Magit refresh
It was possible before, that the utility function
`spacemacs//git-gutter+-refresh-in-all-buffers`
was not defined but called in the package file.
2020-09-23 21:42:46 +02:00
ClarityStorm 497c23a0f1
Fix git-gutter+ refresh on Magit refresh (#13958) 2020-09-23 21:40:45 +02:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
syl20bnr e3acd91118 [core] Rename spacemacs|require to spacemacs|require-when-dumping 2020-09-20 21:17:21 -04:00
Maximilian Wolff 9fd1f89867
Revert Fix git-gutter+ refresh on Magit refresh
this is causing errors in magit after staging a new
file and making a new commit.
2020-09-18 20:54:06 +02:00
Maximilian Wolff 1f869031ab
Replace lambda with named function in gitter refresh fix
Hooks should not include anonymous functions therefore
I have replaced it with a named function.

https://github.com/bbatsov/emacs-lisp-style-guide
2020-09-18 20:22:27 +02:00
ClarityStorm c23b17833c
Fix git-gutter+ refresh on Magit refresh 2020-09-18 20:15:23 +02:00
Codruț Constantin Gușoi 18bd126de4 Change browse-at-remote to "SPC go" sicne it is not github specific 2020-07-18 09:37:11 +02:00
tuh8888 ce5f278a2a [git] Allow multichar major mode leader key for exiting magit commit edits 2020-07-07 16:06:38 +02:00
duianto 0d29f15f6c [source-control] Add Git Blame Transient State
Minified hint:
Chunks: n N p P RET Commits: b r f e q

Full hint:
Chunks                   Commits                     Other
[p/P] prev /same commit  [b] adding lines            [c] cycle style
[n/N] next /same commit  [r] removing lines          [Y] copy hash
[RET] show commit        [f] last commit with lines  [B] magit-blame
                         [e] echo                    [Q] quit TS
                         [q] quit blaming
2020-06-07 18:09:18 +02:00
duianto 4e2ce45aa4 [version-control] Bind SPC g v I (vc-ignore) on startup 2020-05-10 21:18:35 +02:00
duianto 57b1ae7880 [version-control] Load SPC g v keys on startup 2020-05-08 22:27:11 +02:00
Maximilian Wolff 4b11590588
[git] Make M-X switch windows in magit buffers
Before M-1 M-2 M-3 M-4 were bound by magit to show fixed numbers
of details. Now these bindings are available with 1 2 3 4 instead.

The M-X bindings are now used for quick switching of windows as in the
rest of spacemacs.
2020-03-27 20:40:15 +01:00
Maximilian Wolff 96e7621f8a
Fix missing implicit dependency of the git layer to magit-section 2020-01-23 23:53:38 +01:00
madand 081d8f29d4 [version-control] Use :toggle to avoid installation of unused packages
Usage of the `:if` keyword with `use-package` does not prevent Spacemacs form
installing the package, it only prevents the loading in run-time. This commit
employs the `:toggle` feature of the configuration layer system to prevent the
unneeded packages from being installed in the first place.

This further improves upon 31324f68bb
2019-12-27 17:39:51 +01:00
duianto 1de8157a5c Unfold org headings from helm-ag and magit
Unfold org headings to a target line when opening a .org file from:
helm-ag, magit diff or blame buffers
2019-10-19 23:47:45 +02:00
Hong Xu e37b70cfa3 Bound counsel-git to gff and move magit-find-file to gfF.
counsel-git find a file in the current git repository. "gff" is
currently bound to magit-find-file. While counsel-git seemingly performs the
same functionality as magit-find-file, they are substantially different:
magit-find-file is not intended to find a file, contrary to what the
name indicates. See https://github.com/magit/magit/issues/3967 for
explanation. This is why we need another key binding for counsel-git.
2019-10-16 22:03:42 +02:00
Miciah Masters 8d6f736209 Delete old git-link and git-timemachine code
Delete integration code for git-link and git-timemachine, which is
superseded by upstream changes to git-link committed in August 2016:
433ba1dba7

* CHANGELOG.develop: Add an entry for this change.
* layers/+source-control/git/funcs.el (spacemacs/git-link-copy-url-only):
Replace call to spacemacs/git-link with a call to git-link.
(spacemacs/git-link-commit-copy-url-only): Replace call to
spacemacs/git-link-commit with a call to git-link-commit.
(spacemacs/git-link, spacemacs/git-link-commit): Delete functions.
* layers/+source-control/git/packages.el (git/init-git-link): Replace
binding to spacemacs/git-link with a binding to git-link.
2019-10-14 18:18:49 +02:00
Miciah Masters ec0a535b27 Show conflicts in smerge ts hint
Use a dynamic hint for the smerge transient state in order to show the
current and total numbers of conflicts, and make the full hint toggleable.

* CHANGELOG.develop: Add an entry for this change.
* layers/+source-control/version-control/config.el
(spacemacs--smerge-ts-full-hint-toggle): New variable.
* layers/+source-control/version-control/funcs.el
(spacemacs//smerge-ts-hint): New function.  Return a string indicating the
index of the current conflict and the total number of conflicts detected by
smerge-mode.  If spacemacs--smerge-ts-full-hint-toggle is true, append the
smerge transient state's full hint.
(spacemacs//smerge-ts-toggle-hint): Toggle showing the full hint for the
smerge transient state.
* layers/+source-control/version-control/packages.el
(version-control/init-smerge-mode): Define the transient state in :init so
we can use spacemacs|transient-state-format-hint.  Use
spacemacs//smerge-ts-hint to display a dynamic hint.  Bind the ? key to
spacemacs//smerge-ts-toggle-hint.
2019-10-13 10:09:42 +02:00
Roman Gonzalez 28f3b6289d Add spacemacs/git-permalink functionality
Context:

When using org files, one normally tends to add Github code links to an
algorithm/bug explanation so that readers are able to follow along with a PR
change.

The current `<SPC> g l L` command gets us the URL to the current branch; given
the code is in flux, the link becomes non-sensical rather quickly, loosing value
when trying to build a document with explanations about the code.

This PR allows us to get the Permalink (e.g. link associated to the commit, not
the branch); using this, the URL contents will never change with new commits
submitted to the repository.

Changes:

  * Add two new functions with associated keybindings:

    - `<SPC> g l p` maps to `spacemacs/git-permalink`

    - `<SPC> g l P` maps to `spacemacs/git-permalink-copy-url-only`

  * The above changes rely on mechanisms of `git-link`, so no new code needs to
    be introduced
2019-10-05 19:19:41 +02:00
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
Compro-Prasad 42296a91df [org] Fix commit browsing via magit blame in org buffers 2019-09-22 19:21:53 +02:00
emacspace 3747afb4b0 documentation formatting: Fri Aug 23 17:22:19 UTC 2019 2019-08-24 00:03:42 +02:00