-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add information about last commit message
- Loading branch information
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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) | ||
|
@@ -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) | ||
|