Files
emacs.d/site-start.d/501-git.el
Ralf Zerres 6999de3a7f update magit to v 3.1.1
* add lisp path fo git version
* use forge when starting magit in line
* remove magithub dependencies

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
2021-07-25 12:47:34 +02:00

78 lines
2.0 KiB
EmacsLisp

;;; 501-git.el --- git user adaptions
;;; Commentary:
;;; Code:
;; loading standard git.el
;;(require 'git)
;; load magit for git handling
(use-package magit
:ensure t
:bind (("C-x g" . magit-status)
("C-c g" . magit-status)
:map magit-status-mode-map
;;("TAB" . magit-section-toggle)
("<C-tab>" . magit-section-cycle)
:map magit-branch-section-map
("RET" . magit-checkout))
:custom
(magit-use-overlays nil)
(magit-section-visibility-indicator nil)
(magit-completing-read-function 'ivy-completing-read)
(magit-push-always-verify nil)
;;(magit-repository-directories '("~/src/"))
(bind-key "v" 'visit-pull-request-url magit-mode-map)
:config
(add-hook 'after-save-hook 'magit-after-save-refresh-status)
;; handle github, gitlab, gitea api
(use-package forge
:after magit)
(use-package git-timemachine
:bind (("C-x v t" . git-timemachine)))
(use-package git-link
:bind (("C-x v L" . git-link))
:init
(setq git-link-open-in-browser t))
(use-package pcmpl-git)
)
;; Do Not Show Recent Commits in status window
;; https://github.com/magit/magit/issues/3230#issuecomment-339900039
;; (magit-add-section-hook 'magit-status-sections-hook
;; 'magit-insert-unpushed-to-upstream
;; 'magit-insert-unpushed-to-upstream-or-recent
;; 'replace)
;; forge is the successor of magithub
;; (use-package magithub
;; :ensure t
;; :after magit
;; :config
;; (magithub-feature-autoinject t)
;; (setq magithub-clone-default-directory "~/github"))
;;(advice-add 'magit-key-mode :filter-args #'magit-key-mode--add-default-options)
;; (defun visit-pull-request-url ()
;; "Visit the current branch's PR on Github."
;; (interactive)
;; (browse-url
;; (format "https://github.com/%s/pull/new/%s"
;; (replace-regexp-in-string
;; "\\`.+github\\.com:\\(.+\\)\\.git\\'" "\\1"
;; (magit-get "remote"
;; (magit-get-remote)
;; "url"))
;; (cdr (magit-get-remote-branch)))))
(defvar my/magit-default-options
`(
(pulling "--rebase")
))
(provide '501-git)
;; End:
;;; 501-git.el ends here