 
      (define-key magit-status-mode-map (kbd "q") 'magit-quit-session)))
 
--
+(after-load 'magit
+  (define-key magit-status-mode-map (kbd "C-M-<up>") 'magit-goto-parent-section))
+
+;; (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*
-  (add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)]))))
+  (after-load 'magit
+    (add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)])))))
+
+
++
+;; Convenient binding for vc-git-grep
+(global-set-key (kbd "C-x v f") 'vc-git-grep)
+
+
++
+;;; 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)
+
+(after-load 'compile
+  (dolist (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)))
+    (add-to-list 'compilation-error-regexp-alist-alist defn)
+    (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)
+  "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)))
+  (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)))))
+
++
+(require-package 'git-messenger)
+(global-set-key (kbd "C-x v p") #'git-messenger:popup-message)
+
 
 (eval-after-load 'magit
   '(progn

;; show the commit
(autoload 'magit-show-commit "magit" "" t nil)

(global-set-key [(meta f12)] 'magit-status)
(global-set-key [(shift meta f12)] 'magit-status-somedir)


  )
;; }}


(defun git-reset-current-file ()
  "git reset file of current buffer"
