2020-01-27 02:11:10 +01:00
|
|
|
;;; git.el --- magit and stuff. -*- lexical-binding: t; -*-
|
|
|
|
|
2020-06-23 02:26:38 +02:00
|
|
|
;; Time-stamp: <2020-06-23T02:26:26+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
|
2020-06-23 02:26:38 +02:00
|
|
|
:custom (magit-diff-refine-hunk 'all) ; Show word-granularity differences.
|
|
|
|
:bind (("C-x g" . nil) ; Disable default.
|
|
|
|
("C-c g" . magit-status)
|
|
|
|
("C-c M-g" . magit-dispatch)
|
|
|
|
(:map magit-hunk-section-map
|
|
|
|
("RET" . magit-diff-visit-worktree-file-other-window)))
|
|
|
|
:hook (after-save . magit-after-save-refresh-status))
|
2020-01-27 02:11:10 +01:00
|
|
|
|
|
|
|
;; 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-06-23 02:26:38 +02:00
|
|
|
:init (put 'magit-todos-depth 'safe-local-variable #'integerp)
|
|
|
|
:hook (magit-mode . magit-todos-mode))
|
2020-01-27 02:11:10 +01:00
|
|
|
|
|
|
|
;; 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
|