diff options
author | Franck Cuny <franck@fcuny.net> | 2022-01-14 10:55:38 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-01-14 10:55:38 -0800 |
commit | 764177b77321d42e0dd64285f5bb2372f215dd60 (patch) | |
tree | 02fcbd0c095d81ef84fe515174b59e1d15b36efc /emacs | |
parent | zsh: gcloud completion is somewhere else (diff) | |
download | emacs.d-764177b77321d42e0dd64285f5bb2372f215dd60.tar.gz |
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.
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/custom/fcuny-git.el | 67 | ||||
-rw-r--r-- | emacs/custom/fcuny-settings.el | 1 |
2 files changed, 1 insertions, 67 deletions
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 |