branch: externals/agitate commit eb39cc912b4cb4fdcf84c7e16f349ef11f394c20 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Apply vc-log-show-limit where relevant --- README.org | 12 ++++++++---- agitate.el | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/README.org b/README.org index ed5207ac47..daa58d430a 100644 --- a/README.org +++ b/README.org @@ -157,15 +157,19 @@ commits" are documented here: <https://www.conventionalcommits.org/en/v1.0.0/>. + ~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. + The number of completion candidates is limited to the value of + ~vc-log-show-limit~. #+findex: agitate-vc-git-format-patch-single -+ ~agitate-vc-git-format-patch-single~ :: Format patch for a - single =COMMIT=. If in a log-view buffer, the =COMMIT= is the one - at point. For the details of how that is determined, read the doc ++ ~agitate-vc-git-format-patch-single~ :: Format patch for a single + =COMMIT=. If in a log-view buffer, the =COMMIT= is the one at + point. For the details of how that is determined, read the doc string of ~agitate-log-view-kill-revision~. If there is no such commit at point, prompt for =COMMIT= using minibuffer completion. Output the patch file to the return value of the function - ~vc-root-dir~. Relevant except from the source code: + ~vc-root-dir~. The number of completion candidates is limited to + the value of ~vc-log-show-limit~. Relevant except from the source + code: #+begin_src emacs-lisp ;; TODO 2022-09-27: Handle the output directory better. Though I am diff --git a/agitate.el b/agitate.el index b8d7477e09..37cfa363fb 100644 --- a/agitate.el +++ b/agitate.el @@ -275,11 +275,14 @@ With optional LONG do not abbreviate commit hashes." (let* ((prompt (if file (format "Select revision of `%s': " file) "Select revision: ")) - (commit-format (if long "--pretty=oneline" "--oneline")) (default-directory (vc-root-dir))) (completing-read prompt - (process-lines vc-git-program "log" commit-format (or file "--")) + (process-lines + vc-git-program "log" + (format "-n %d" vc-log-show-limit) + (if long "--pretty=oneline" "--oneline") + (or file "--")) nil t))) (defvar agitate-vc-git-show-buffer "*agitate-vc-git-show*" @@ -291,7 +294,10 @@ With optional LONG do not abbreviate commit hashes." 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." +to those pertaining to the current file. + +The number of completion candidates is limited to the value of +`vc-log-show-limit'." (declare (interactive-only t)) (interactive "P") (when-let* ((file (caadr (vc-deduce-fileset))) ; FIXME 2022-09-27: Better way to get current file? @@ -324,7 +330,10 @@ If there is no such commit at point, prompt for COMMIT using minibuffer completion. Output the patch file to the return value of the function -`vc-root-dir'." +`vc-root-dir'. + +The number of completion candidates is limited to the value of +`vc-log-show-limit'." (interactive (list (agitate--vc-git-format-patch-single-commit))) ;; TODO 2022-09-27: Handle the output directory better. Though I am ;; not sure how people work with those. I normally use the root of