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