forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-git.el
50 lines (39 loc) · 1.87 KB
/
init-git.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;(setq load-path (cons (expand-file-name "/usr/share/doc/git-core/contrib/emacs") load-path))
;; Downloaded from http://git.kernel.org/?p=git/git.git ;a=tree;hb=HEAD;f=contrib/emacs
(require 'vc-git)
(when (featurep 'vc-git) (add-to-list 'vc-handled-backends 'git))
(autoload 'git-blame-mode "git-blame" "Minor mode for incremental blame for Git." t)
(require 'magit)
(setq magit-save-some-buffers nil)
(setq magit-process-popup-time 4)
(setq magit-completing-read-function 'magit-ido-completing-read)
(defun magit-status-somedir ()
(interactive)
(let ((current-prefix-arg t))
(magit-status default-directory)))
(global-set-key [(meta f12)] 'magit-status)
(global-set-key [(shift meta f12)] 'magit-status-somedir)
(when *is-a-mac*
(add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)]))))
(require 'magit-svn)
(require 'rebase-mode)
(require 'magithub)
(require 'diff-git)
;;----------------------------------------------------------------------------
;; git-svn conveniences
;;----------------------------------------------------------------------------
(eval-after-load "compile"
'(progn
(mapcar (lambda (defn) (add-to-list 'compilation-error-regexp-alist-alist defn))
(list '(git-svn-updated "^\t[A-Z]\t\\(.*\\)$" 1 nil nil 0 1)
'(git-svn-needs-update "^\\(.*\\): needs update$" 1 nil nil 2 1)))
(mapcar (lambda (defn) (add-to-list 'compilation-error-regexp-alist defn))
(list 'git-svn-updated 'git-svn-needs-update))))
(defun git-svn (dir)
(interactive "DSelect directory: ")
(let* ((default-directory (git-get-top-dir dir))
(compilation-buffer-name-function (lambda (major-mode-name) "*git-svn*")))
(compile (concat "git svn "
(ido-completing-read "git-svn command: "
(list "rebase" "dcommit" "fetch" "log") nil t)))))
(provide 'init-git)