Skip to content

Commit

Permalink
add information about last commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Artawower committed Jun 21, 2024
1 parent 158524c commit 36fb346
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion file-info.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Artur Yaroshenko <[email protected]>
;; URL: https://github.com/artawower/file-info.el
;; Package-Requires: ((emacs "28.1") (hydra "0.15.0") (browse-at-remote "0.15.0"))
;; Version: 0.7.0
;; Version: 0.7.1

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -137,6 +137,12 @@
:cache t
:face font-lock-builtin-face
:bind "r")
(:name
"Last commit message"
:handler (file-info--get-last-commit-message)
:cache t
:face font-lock-builtin-face
:bind "g")
(:name
"Branch"
:handler (file-info--get-current-branch)
Expand Down Expand Up @@ -237,6 +243,11 @@
(split-string (car-safe (split-string (buffer-string) "\n"))
"|")))))

(defun file-info--get-last-commit-message ()
"Get the last commit message for the entire Git repository."
(shell-command-to-string "git log -1 --pretty=format:%s"))


(defun file-info--get-last-commit-info ()
"Get last commit hash and user name via VC."
(when-let ((git-p file-info--git-p)
Expand Down

0 comments on commit 36fb346

Please sign in to comment.