[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate 496eba8497 52/67: Add agitate-vc-git-show proto
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate 496eba8497 52/67: Add agitate-vc-git-show prototype |
Date: |
Wed, 28 Sep 2022 16:57:29 -0400 (EDT) |
branch: externals/agitate
commit 496eba849761c567a22d26e1b987319b99b9535a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add agitate-vc-git-show prototype
---
README.org | 5 +++++
agitate.el | 18 +++++++++++++-----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index e3fc949a8c..17d9b61f30 100644
--- a/README.org
+++ b/README.org
@@ -148,6 +148,11 @@ think most of those are superfluous. Less is more.
:CUSTOM_ID: h:f1a1f462-b6db-415a-b8e6-ba23788cb6e3
:END:
+#+findex: agitate-vc-git-show
++ ~agitate-vc-git-show~ :: PROTOTYPE. Prompt for commit and run
+ =git-show(1)= on it. With optional =CURRENT-FILE= as prefix
+ argument, limit the commits to those pertaining to the current file.
+
#+findex: agitate-vc-git-grep
+ ~agitate-vc-git-grep~ :: Run ~git-grep(1)~ for =REGEXP= in
~vc-root-dir~. This is a simple wrapper around ~vc-git-grep~ to
diff --git a/agitate.el b/agitate.el
index c37ea99cba..cdc903371e 100644
--- a/agitate.el
+++ b/agitate.el
@@ -255,14 +255,22 @@ With optional FILE, limit the commits to those pertinent
to it."
"Buffer for showing a git commit.")
;;;###autoload
-(defun vc-git-show ()
- "PROOF OF CONCEPT."
- (interactive)
+(defun agitate-vc-git-show (&optional current-file)
+ "PROTOTYPE.
+
+Prompt for commit and run `git-show(1)' on it.
+With optional CURRENT-FILE as prefix argument, limit the commits
+to those pertaining to the current file."
+ (interactive "P")
(when-let* ((file (caadr (vc-deduce-fileset))) ; FIXME 2022-09-27: Better
way to get current file?
(revision (agitate--vc-git-get-hash-from-string
- (agitate--vc-git-commit-prompt file)))
+ (agitate--vc-git-commit-prompt
+ (when current-file file))))
(buf "*agitate-vc-git-show*"))
- (apply 'vc-git-command (get-buffer-create buf) nil file (list "show"
revision))
+ (apply 'vc-git-command (get-buffer-create buf) nil (when current-file file)
+ (list "show" "--patch-with-stat" revision))
+ ;; TODO 2022-09-27: What else do we need to set up in such a
+ ;; buffer?
(with-current-buffer (pop-to-buffer buf)
(diff-mode))))
- [elpa] externals/agitate a32ed823b6 24/67: Add TODO about conventional commits, (continued)
- [elpa] externals/agitate a32ed823b6 24/67: Add TODO about conventional commits, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate fa0a9e5260 42/67: Add echo to agitate-vc-git-kill-commit-message, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 063d94c983 35/67: Add generic README in markdown, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate f9dd3b3f91 41/67: Add agitate-vc-git-kill-commit-message command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate ca4b65bf85 36/67: Add gitignore, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 0b80819820 62/67: Refine regexp for git hash extraction, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 45eb3b6c5d 54/67: Declare agitate-vc-git-show as interactive-only, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 912161bfc1 27/67: Add doclicense.texi which is used in the manual, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 6eb66ed1cc 44/67: Add helper to extract commit hash, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 8bb7652cac 43/67: Rename to agitate-vc-git-grep, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 496eba8497 52/67: Add agitate-vc-git-show prototype,
ELPA Syncer <=
- [elpa] externals/agitate 1e998e1466 59/67: Rename helper for single commit command, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate de2094a2f5 53/67: Placate the compiler, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 50251c7eff 64/67: Add agitate-log-view-kill-revision-expanded cmd, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 60dea993b9 25/67: Add COPYING GNU General Public License, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate a2173cf82c 39/67: Implement conventional commits; refine emoji commits, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate acaa1868d0 30/67: Move log-view section further down, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 2b8a593a5d 38/67: Add missing backronym from README.md, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate 52c9968e5f 19/67: Refine agitate-vc-git-push doc string, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate b7a51e04d2 18/67: Adjust indentation, ELPA Syncer, 2022/09/28
- [elpa] externals/agitate f29bc8e32a 21/67: Reorder some functions, ELPA Syncer, 2022/09/28