Compare commits

..

1 Commits

Author SHA1 Message Date
584480bd53
Add state information to eshell git prompt 2022-08-29 18:59:06 +02:00

View File

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