summaryrefslogtreecommitdiff
path: root/emacs/custom/fcuny-git.el
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs/custom/fcuny-git.el43
1 files changed, 42 insertions, 1 deletions
diff --git a/emacs/custom/fcuny-git.el b/emacs/custom/fcuny-git.el
index e3b8c45..a6a3829 100644
--- a/emacs/custom/fcuny-git.el
+++ b/emacs/custom/fcuny-git.el
@@ -14,7 +14,48 @@
:after (flyspell)
:bind (("C-x g" . magit-status))
:custom
- (vc-follow-symlinks t))
+ (vc-follow-symlinks t)
+ :config
+ ;; if we're on darwin, we're on a work laptop, so let's make sure we
+ ;; use the proper `git' binary.
+ (when (string= system-type "darwin")
+ (setq magit-git-executable "/opt/twitter_mde/bin/git"))
+ ;; I want to see these things by default
+ (add-to-list 'magit-section-initial-visibility-alist '(untracked . show))
+ (add-to-list 'magit-section-initial-visibility-alist '(unstaged . show))
+ (add-to-list 'magit-section-initial-visibility-alist '(unpulled . show))
+ (add-to-list 'magit-section-initial-visibility-alist '(unpushed . show))
+ (add-to-list 'magit-section-initial-visibility-alist '(stashes . show))
+ ;; 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)))
(use-package git-commit
:ensure t