From 764177b77321d42e0dd64285f5bb2372f215dd60 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 14 Jan 2022 10:55:38 -0800 Subject: emacs: simplify git/magit configuration I don't have to deal with magit anymore, so I can drop all the stuff that removed the VC stuff. --- emacs/custom/fcuny-git.el | 67 +----------------------------------------- emacs/custom/fcuny-settings.el | 1 - 2 files changed, 1 insertion(+), 67 deletions(-) (limited to 'emacs') diff --git a/emacs/custom/fcuny-git.el b/emacs/custom/fcuny-git.el index 5425bb8..eac237c 100644 --- a/emacs/custom/fcuny-git.el +++ b/emacs/custom/fcuny-git.el @@ -16,68 +16,8 @@ :bind (("C-x g" . magit-status)) :custom (vc-follow-symlinks t) - :config - (defun fcuny/magit-settings-for-work () - "Settings to apply for work. The main monorepo at work is too large for most of the default settings with magit." - ;; if we're on darwin, we're on a work laptop, so let's make sure we - ;; use the proper `git' binary. - (setq magit-git-executable "/opt/twitter_mde/bin/git") - - ;; no need to show the last 10 commits, 5 is enough. - (setq magit-log-section-commit-count 5) - - ;; when working with source, some of the hooks are extremely - ;; expensive and don't add much values (i.e tags). Let's reduce the - ;; list to things that are actually useful. This still takes ~10 - ;; seconds when running `magit-status'. - (setq git-commit-setup-hook - '(git-commit-save-message - git-commit-turn-on-auto-fill - git-commit-turn-on-flyspell - git-commit-propertize-diff - with-editor-usage-message)) - (setq magit-refs-sections-hook - '(magit-insert-error-header - magit-insert-branch-description - magit-insert-local-branches)) - (setq magit-status-sections-hook - '(magit-insert-status-headers - magit-insert-merge-log - magit-insert-rebase-sequence - magit-insert-am-sequence - magit-insert-sequencer-sequence - magit-insert-untracked-files - magit-insert-unstaged-changes - magit-insert-staged-changes - magit-insert-stashes)) - (setq magit-status-headers-hook - '(magit-insert-error-header - magit-insert-diff-filter-header - magit-insert-head-branch-header))) - - (defun fcuny/magit-settings () - ;; Add a "latest commits" section - (magit-add-section-hook 'magit-status-sections-hook - 'magit-insert-recent-commits - nil t) - (magit-add-section-hook 'magit-status-sections-hook - 'magit-insert-unpushed-to-upstream - 'magit-insert-unpushed-to-upstream-or-recent - 'replace)) - - (when (fcuny/check-work-machine-p) - (fcuny/magit-settings-for-work) - (fcuny/magit-settings)) - :custom - (magit-completing-read-function 'ivy-completing-read) - (magit-section-initial-visibility-alist - '((stashes . show) - (unpushed . how) - (unpulled . show) - (recent . show) - (untracked . show) - (unstaged . show)))) + (magit-completing-read-function 'ivy-completing-read)) (use-package magit-repos :ensure nil @@ -148,11 +88,6 @@ (dir-locals-set-directory-class "/Users/fcuny/workspace/source" 'huge-git-repository) -;; https://magit.vc/manual/magit/Performance.html -;; disable Git from the VC mode, since we use magit. This should help -;; with performances. -(setq vc-handled-backends (delq 'Git vc-handled-backends)) - (defun fcuny/clone-repo (url) "Clone a repository in the workspace" (interactive "sURL:") diff --git a/emacs/custom/fcuny-settings.el b/emacs/custom/fcuny-settings.el index 4db0f95..cb6d7d8 100644 --- a/emacs/custom/fcuny-settings.el +++ b/emacs/custom/fcuny-settings.el @@ -24,7 +24,6 @@ (setq column-number-mode t) ;; show column number in the mode line (setq-default indent-tabs-mode nil) ;; turn off tab indentation (setq-default cursor-type 'hbar) ;; cursor is a horizontal bar -(setq vc-handled-backends nil) ;; don't use the VC backend, it's too slow with source (setq-default delete-by-moving-to-trash t) ;; delete files by moving them to the trash (setq initial-scratch-message "") ;; empty scratch buffer (setq garbage-collection-messages t) ;; log when the gc kicks in -- cgit 1.4.1