diff options
| author | jao <jao@gnu.org> | 2025-12-02 11:37:17 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2025-12-07 13:51:45 +0000 |
| commit | 4a8f924b4a8a87c593f307a9434e730a5c6c6432 (patch) | |
| tree | 357dd3b6c0bfe7790b9f8af3ce8d6a60d5aef73d /init.el | |
| parent | 8cc2a8d1b1ba8445c35ac3e02720a03fc04fd9b6 (diff) | |
| download | elibs-4a8f924b4a8a87c593f307a9434e730a5c6c6432.tar.gz elibs-4a8f924b4a8a87c593f307a9434e730a5c6c6432.tar.bz2 | |
eshell: abbreviated git branch names
Diffstat (limited to 'init.el')
| -rw-r--r-- | init.el | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1458,7 +1458,13 @@ (format "%s%s" (match-string 1 desc) (jao-eshell--git-dirty)))))) (defun jao-eshell--git-current-branch (suffix) - (let ((desc (or (jao-eshell--git-info) ""))) + (let* ((descs (string-split (or (jao-eshell--git-info) "") "/")) + (desc (if (cdr descs) + (concat (mapconcat (lambda (s) (substring s 0 1)) + (butlast descs) + "/") + "/" (car (last descs))) + (car descs)))) (cond ((and (string-empty-p desc) suffix) (format " (%s)" suffix)) ((string-empty-p (or suffix "")) (format " (%s)" desc)) (t (format " (%s %s)" desc suffix))))) |
