diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-01-28 23:14:22 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-01-28 23:14:22 -0500 |
commit | dda8b2d4f5f76c4d83fb2d5ce033f07c688ffa3e (patch) | |
tree | f5df5f9148d90fc014a2890cbf65620de65f1e8c /lisp | |
parent | cfbf0675a02e47df401fbe5a20cf95c955cbbc1a (diff) | |
download | emacs.d-dda8b2d4f5f76c4d83fb2d5ce033f07c688ffa3e.tar.gz |
Add magit-describe command
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/km-magit.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 6c4ed39..9544e1d 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -500,6 +500,19 @@ function." 'km/magit-copy-hook current-prefix-arg)) (magit-copy-section-value))) +(defun km/magit-describe (rev) + "Run 'git describe' on REV." + (interactive + (list (or (-when-let (section (magit-current-section)) + (cond + ((memq (magit-section-type section) '(commit branch)) + (magit-section-value section)) + ((derived-mode-p 'magit-revision-mode) + (car magit-refresh-args)))) + (magit-read-branch-or-commit "Revision")))) + (--when-let (and rev (magit-git-string "describe" rev)) + (kill-new (message it)))) + (defun km/magit-rev-ancestor-p (rev-a rev-b) "Report whether REV-A is the ancestor of REV-B. Use the revision at point as REV-B. With prefix argument or if |