(defun my/magit-commit-all ()
"Publish the current file and commit all the current changes."
(magit-status default-directory)
(call-interactively 'magit-log-edit))
(use-package magit
:load-path "~/.emacs.d/magit"
(when (equal system-type 'windows-nt)
(setq magit-git-executable "c:/program files (x86)/git/bin/git.exe"))
(setq magit-diff-options '("-b")) ; ignore whitespace
(define-key magit-mode-map "#gg" 'endless/load-gh-pulls-mode)
(defvar my/magit-limit-to-directory nil "Limit magit status to a specific directory.")
(defun my/magit-status-in-directory (directory)
"Displays magit status limited to DIRECTORY.
Uses the current `default-directory', or prompts for a directory
if called with a prefix argument. Sets `my/magit-limit-to-directory'
so that it's still active even after you stage a change. Very experimental."
(interactive (list (expand-file-name
(if current-prefix-arg
(read-directory-name "Directory: ")
(setq my/magit-limit-to-directory directory)
(magit-status directory))
(defadvice magit-insert-untracked-files (around sacha activate)
(if my/magit-limit-to-directory
(magit-with-section (section untracked 'untracked "Untracked files:" t)
(let ((files (cl-mapcan
(lambda (f)
(when (eq (aref f 0) ??) (list f)))
"status" "--porcelain" "--" my/magit-limit-to-directory))))
(if (not files)
(setq section nil)
(dolist (file files)
(setq file (magit-decode-git-path (substring file 3)))
(magit-with-section (section file file)
(insert "\t" file "\n")))
(insert "\n"))))
(defadvice magit-insert-unstaged-changes (around sacha activate)
(if my/magit-limit-to-directory
(let ((magit-current-diff-range (cons 'index 'working))
(magit-diff-options (copy-sequence magit-diff-options)))
(magit-git-insert-section (unstaged "Unstaged changes:")
"--" my/magit-limit-to-directory
(defadvice magit-insert-staged-changes (around sacha activate)
"Limit to `my/magit-limit-to-directory' if specified."
(if my/magit-limit-to-directory
(let ((no-commit (not (magit-git-success "log" "-1" "HEAD"))))
(when (or no-commit (magit-anything-staged-p))
(let ((magit-current-diff-range (cons "HEAD" 'index))
(base (if no-commit
(magit-git-string "mktree")
(magit-diff-options (append '("--cached") magit-diff-options)))
(magit-git-insert-section (staged "Staged changes:")
(apply-partially #'magit-wash-raw-diffs t)
"diff-index" "--cached" base "--" my/magit-limit-to-directory))))
:bind (("C-x v d" . magit-status)
("C-x v C-d" . my/magit-status-in-directory)
("C-x v p" . magit-push)
("C-x v c" . my/magit-commit-all)))
;; From
(defun endless/load-gh-pulls-mode ()
"Start `magit-gh-pulls-mode' only after a manual request."
(require 'magit-gh-pulls)
(add-hook 'magit-mode-hook 'turn-on-magit-gh-pulls)
(magit-gh-pulls-mode 1)
(use-package magit-gh-pulls)


shows commit message

(use-package git-messenger
:bind (("C-x v m" . git-messenger:popup-message)))