|
|
|
@@ -1,50 +1,34 @@ |
|
|
|
;; TODO: link commits from vc-log to magit-show-commit |
|
|
|
;; TODO: smerge-mode |
|
|
|
(require-package 'magit) |
|
|
|
(require-package 'git-blame) |
|
|
|
(require-package 'git-commit-mode) |
|
|
|
(require-package 'git-rebase-mode) |
|
|
|
(require-package 'gitignore-mode) |
|
|
|
(require-package 'gitconfig-mode) |
|
|
|
(require-package 'git-messenger) ;; Though see also vc-annotate's "n" & "p" bindings |
|
|
|
(require-package 'git-timemachine) |
|
|
|
|
|
|
|
(setq-default |
|
|
|
magit-save-some-buffers nil |
|
|
|
magit-process-popup-time 10 |
|
|
|
magit-diff-refine-hunk t |
|
|
|
magit-completing-read-function 'magit-ido-completing-read) |
|
|
|
|
|
|
|
;; Hint: customize `magit-repo-dirs' so that you can use C-u M-F12 to |
|
|
|
;; quickly open magit on any one of your projects. |
|
|
|
(global-set-key [(meta f12)] 'magit-status) |
|
|
|
(when (maybe-require-package 'magit) |
|
|
|
(setq-default |
|
|
|
magit-process-popup-time 10 |
|
|
|
magit-diff-refine-hunk t |
|
|
|
magit-completing-read-function 'magit-ido-completing-read) |
|
|
|
|
|
|
|
;; Hint: customize `magit-repo-dirs' so that you can use C-u M-F12 to |
|
|
|
;; quickly open magit on any one of your projects. |
|
|
|
(global-set-key [(meta f12)] 'magit-status) |
|
|
|
(global-set-key (kbd "C-x g") 'magit-status) |
|
|
|
(global-set-key (kbd "C-x M-g") 'magit-dispatch-popup)) |
|
|
|
|
|
|
|
(after-load 'magit |
|
|
|
(define-key magit-status-mode-map (kbd "C-M-<up>") 'magit-goto-parent-section)) |
|
|
|
(define-key magit-status-mode-map (kbd "C-M-<up>") 'magit-section-up) |
|
|
|
(add-hook 'magit-popup-mode-hook 'sanityinc/no-trailing-whitespace)) |
|
|
|
|
|
|
|
(require-package 'fullframe) |
|
|
|
(after-load 'magit |
|
|
|
(fullframe magit-status magit-mode-quit-window)) |
|
|
|
|
|
|
|
(add-hook 'git-commit-mode-hook 'goto-address-mode) |
|
|
|
(after-load 'session |
|
|
|
(add-to-list 'session-mode-disable-list 'git-commit-mode)) |
|
|
|
|
|
|
|
|
|
|
|
;;; When we start working on git-backed files, use git-wip if available |
|
|
|
|
|
|
|
(after-load 'magit |
|
|
|
(global-magit-wip-save-mode) |
|
|
|
(diminish 'magit-wip-save-mode)) |
|
|
|
|
|
|
|
(after-load 'magit |
|
|
|
(diminish 'magit-auto-revert-mode)) |
|
|
|
|
|
|
|
|
|
|
|
(when *is-a-mac* |
|
|
|
(after-load 'magit |
|
|
|
(add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)]))))) |
|
|
|
|
|
|
|
(when (maybe-require-package 'git-commit) |
|
|
|
(add-hook 'git-commit-mode-hook 'goto-address-mode)) |
|
|
|
|
|
|
|
|
|
|
|
;; Convenient binding for vc-git-grep |
|
|
|
@@ -54,12 +38,13 @@ |
|
|
|
|
|
|
|
;;; git-svn support |
|
|
|
|
|
|
|
(require-package 'magit-svn) |
|
|
|
(autoload 'magit-svn-enabled "magit-svn") |
|
|
|
(defun sanityinc/maybe-enable-magit-svn-mode () |
|
|
|
(when (magit-svn-enabled) |
|
|
|
(magit-svn-mode))) |
|
|
|
(add-hook 'magit-status-mode-hook #'sanityinc/maybe-enable-magit-svn-mode) |
|
|
|
;; (when (maybe-require-package 'magit-svn) |
|
|
|
;; (require-package 'magit-svn) |
|
|
|
;; (autoload 'magit-svn-enabled "magit-svn") |
|
|
|
;; (defun sanityinc/maybe-enable-magit-svn-mode () |
|
|
|
;; (when (magit-svn-enabled) |
|
|
|
;; (magit-svn-mode))) |
|
|
|
;; (add-hook 'magit-status-mode-hook #'sanityinc/maybe-enable-magit-svn-mode)) |
|
|
|
|
|
|
|
(after-load 'compile |
|
|
|
(dolist (defn (list '(git-svn-updated "^\t[A-Z]\t\\(.*\\)$" 1 nil nil 0 1) |
|
|
|
@@ -68,19 +53,20 @@ |
|
|
|
(add-to-list 'compilation-error-regexp-alist (car defn)))) |
|
|
|
|
|
|
|
(defvar git-svn--available-commands nil "Cached list of git svn subcommands") |
|
|
|
|
|
|
|
(defun git-svn (dir) |
|
|
|
(defun git-svn--available-commands () |
|
|
|
(or git-svn--available-commands |
|
|
|
(setq git-svn--available-commands |
|
|
|
(sanityinc/string-all-matches |
|
|
|
"^ \\([a-z\\-]+\\) +" |
|
|
|
(shell-command-to-string "git svn help") 1)))) |
|
|
|
|
|
|
|
(defun git-svn (dir command) |
|
|
|
"Run a git svn subcommand in DIR." |
|
|
|
(interactive "DSelect directory: ") |
|
|
|
(unless git-svn--available-commands |
|
|
|
(setq git-svn--available-commands |
|
|
|
(sanityinc/string-all-matches |
|
|
|
"^ \\([a-z\\-]+\\) +" |
|
|
|
(shell-command-to-string "git svn help") 1))) |
|
|
|
(interactive (list (read-directory-name "Directory: ") |
|
|
|
(completing-read "git-svn command: " (git-svn--available-commands) nil t nil nil (git-svn--available-commands)))) |
|
|
|
(let* ((default-directory (vc-git-root dir)) |
|
|
|
(compilation-buffer-name-function (lambda (major-mode-name) "*git-svn*"))) |
|
|
|
(compile (concat "git svn " |
|
|
|
(ido-completing-read "git-svn command: " git-svn--available-commands nil t))))) |
|
|
|
(compile (concat "git svn " command)))) |
|
|
|
|
|
|
|
|
|
|
|
(require-package 'git-messenger) |