emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vc-got a323f60 071/145: show list of files when committ


From: ELPA Syncer
Subject: [elpa] externals/vc-got a323f60 071/145: show list of files when committing staged stuff
Date: Thu, 9 Sep 2021 15:58:36 -0400 (EDT)

branch: externals/vc-got
commit a323f6038c66d12f4a3f5b4c136b7bfdbc62f405
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>

    show list of files when committing staged stuff
---
 vc-got-stage.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/vc-got-stage.el b/vc-got-stage.el
index 461b819..5146237 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -32,7 +32,9 @@
 (defvar vc-got-program)                 ;vc-got.el
 (declare-function vc-got--diff    "vc-got")
 (declare-function vc-got--unstage "vc-got" (file))
+(declare-function vc-got--status  "vc-got" (status-codes dir &rest files))
 (declare-function vc-got-checkin  "vc-got" (fileset comment))
+(declare-function vc-got-root     "vc-got" (dir-or-file))
 
 (defvar vc-got-stage--process nil
   "The got stage process.")
@@ -132,7 +134,11 @@ If FILESET is nil, show the diff for every staged hunks."
 (defun vc-got-stage-commit ()
   "Commit staged hunks."
   (interactive)
-  (let ((buf (get-buffer-create "*vc-got-stage-commit*")))
+  (let* ((buf (get-buffer-create "*vc-got-stage-commit*"))
+         (status (vc-got--status "M" "."))
+         (staged-files (cl-loop for (file _ staged) in status
+                                when staged
+                                collect file)))
     (pop-to-buffer buf)
     (log-edit (lambda ()
                 (interactive)
@@ -141,9 +147,9 @@ If FILESET is nil, show the diff for every staged hunks."
                   (kill-buffer)
                   (vc-got-checkin nil msg)))
               t
-              ;; TODO: add here an alist of
-              ;; '((vc-log-fileset . (staged-files)))
-              )))
+              `((log-edit-listfun . ,(lambda ()
+                                       (mapcar #'file-relative-name
+                                               staged-files)))))))
 
 (provide 'vc-got-stage)
 ;;; vc-got-stage.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]