2020-01-27 02:11:10 +01:00
|
|
|
;;; git.el --- magit and stuff. -*- lexical-binding: t; -*-
|
|
|
|
|
2020-05-03 04:32:45 +02:00
|
|
|
;; Time-stamp: <2020-05-03T04:32:34+0200>
|
2020-01-27 02:11:10 +01:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-03-18 15:00:17 +01:00
|
|
|
(require 'basics/package-management)
|
2020-01-27 02:11:10 +01:00
|
|
|
(require 'basics/global-variables)
|
|
|
|
|
|
|
|
;; Git integration.
|
|
|
|
(use-package git-commit
|
2020-04-20 21:28:19 +02:00
|
|
|
:defer 2
|
|
|
|
:config (defun my/set-git-commit-fill-column ()
|
2020-04-22 03:17:44 +02:00
|
|
|
(setq-local fill-column 72))
|
2020-04-20 21:28:19 +02:00
|
|
|
:hook (git-commit-mode . my/set-git-commit-fill-column))
|
2020-01-27 02:11:10 +01:00
|
|
|
|
|
|
|
(unless slow-computer
|
|
|
|
(use-package magit
|
|
|
|
:custom
|
|
|
|
(magit-diff-refine-hunk 'all) ; Show word-granularity differences.
|
|
|
|
|
|
|
|
:bind
|
2020-04-21 16:35:42 +02:00
|
|
|
("C-x g" . nil) ; Disable default.
|
2020-03-27 17:11:14 +01:00
|
|
|
("C-c g" . magit-status)
|
|
|
|
("C-c M-g" . magit-dispatch)
|
2020-01-27 02:11:10 +01:00
|
|
|
|
|
|
|
:hook
|
|
|
|
(after-save . magit-after-save-refresh-status)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Use libgit rather than git.
|
2020-04-10 14:17:47 +02:00
|
|
|
(use-package magit-libgit)
|
2020-01-27 02:11:10 +01:00
|
|
|
|
|
|
|
;; Show TODOs in magit-status.
|
|
|
|
(use-package magit-todos
|
|
|
|
:after magit
|
|
|
|
|
2020-04-10 14:06:21 +02:00
|
|
|
:init
|
2020-01-27 02:11:10 +01:00
|
|
|
;; Mark variables as safe. This prevents prompts when using .dir-locals.el.
|
|
|
|
(put 'magit-todos-depth 'safe-local-variable #'integerp)
|
|
|
|
|
|
|
|
:hook
|
|
|
|
(magit-mode . magit-todos-mode)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Work with Git forges from Magit.
|
|
|
|
(use-package forge
|
|
|
|
:after magit
|
|
|
|
|
2020-04-20 21:27:46 +02:00
|
|
|
:config (add-to-list 'forge-alist
|
|
|
|
'("schlomp.space" "schlomp.space/api/v1"
|
|
|
|
"schlomp.space" forge-gitea-repository))
|
|
|
|
:hook (prog-mode . forge-bug-reference-setup))
|
2020-01-27 02:11:10 +01:00
|
|
|
) ; unless slow-computer.
|
|
|
|
|
|
|
|
(provide 'programming/git)
|
|
|
|
;;; git.el ends here
|