Add a rev number to SPC hds.
Describe system information was useless if we don't know which rev. people are using. This adds this information.
This commit is contained in:
parent
a8582813c0
commit
7da1b876aa
|
@ -208,11 +208,28 @@ version and the NEW version."
|
|||
(kill-buffer proc-buffer))))
|
||||
|
||||
(defun spacemacs/git-get-current-branch ()
|
||||
"Return the current branch. Return nil if an error occurred."
|
||||
(let((proc-buffer "git-get-current-branch")
|
||||
"Return the current branch. Return nil if an error occurred."
|
||||
(let((proc-buffer "git-get-current-branch")
|
||||
(default-directory (file-truename user-emacs-directory)))
|
||||
(when (eq 0 (process-file "git" nil proc-buffer nil
|
||||
"symbolic-ref" "--short" "-q" "HEAD"))
|
||||
(with-current-buffer proc-buffer
|
||||
(prog1
|
||||
(when (buffer-string)
|
||||
(goto-char (point-min))
|
||||
(replace-regexp-in-string
|
||||
"\n$" ""
|
||||
(buffer-substring (line-beginning-position)
|
||||
(line-end-position))))
|
||||
(kill-buffer proc-buffer))))))
|
||||
|
||||
(defun spacemacs/git-get-current-branch-rev ()
|
||||
"Returns the hash of the head commit on the current branch.
|
||||
Returns nil if an error occurred."
|
||||
(let((proc-buffer "git-get-current-branch-head-hash")
|
||||
(default-directory (file-truename user-emacs-directory)))
|
||||
(when (eq 0 (process-file "git" nil proc-buffer nil
|
||||
"symbolic-ref" "--short" "-q" "HEAD"))
|
||||
"rev-parse" "--short" "HEAD"))
|
||||
(with-current-buffer proc-buffer
|
||||
(prog1
|
||||
(when (buffer-string)
|
||||
|
|
|
@ -249,12 +249,13 @@ FILE-TO-LOAD is an explicit file to load after the installation."
|
|||
"- OS: %s\n"
|
||||
"- Emacs: %s\n"
|
||||
"- Spacemacs: %s\n"
|
||||
"- Spacemacs branch: %s\n"
|
||||
"- Spacemacs branch: %s (rev. %s)\n"
|
||||
"- Layers:\n```elisp\n%s```\n")
|
||||
system-type
|
||||
emacs-version
|
||||
spacemacs-version
|
||||
(spacemacs/git-get-current-branch)
|
||||
(spacemacs/git-get-current-branch-rev)
|
||||
(pp dotspacemacs-configuration-layers))))
|
||||
(kill-new sysinfo)
|
||||
(message sysinfo)
|
||||
|
|
Loading…
Reference in New Issue