Compare commits

..

1 Commits

Author SHA1 Message Date
df92555538
Add state information to eshell git prompt 2022-08-29 18:46:07 +02:00

View File

@ -82,16 +82,13 @@ git repository."
(list (list
(when (file-exists-p (file-name-concat "." ".git" "MERGE_HEAD")) (when (file-exists-p (file-name-concat "." ".git" "MERGE_HEAD"))
"merge") "merge")
(when (= 1 (call-process "git" nil nil nil (unless (= 0 (call-process "git" nil nil nil
"diff" "--no-ext-diff" "--quiet" "--exit-code")) "diff" "--no-ext-diff" "--quiet"))
"dirty") "dirty")
(when (= 1 (call-process "git" nil nil nil (unless (= 0 (call-process "git" nil nil nil
"diff" "--no-ext-diff" "--quiet" "--exit-code" "--cached")) "diff" "--no-ext-diff" "--quiet" "--cached"))
"uncommitted") "uncommitted")
(when (with-temp-buffer (unless (string-empty-p (shell-command-to-string "git stash list --quiet"))
(and (= 0 (call-process "git" nil t nil
"stash" "list"))
(not (= 0 (buffer-size)))))
"stash"))))) "stash")))))
(if state-list (if state-list
(format "%s@%s[%s]" git-branch base-dir (apply #'concat (-interpose "|" state-list))) (format "%s@%s[%s]" git-branch base-dir (apply #'concat (-interpose "|" state-list)))