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

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

[elpa] externals/vc-got d346ca6 084/145: ignore ignored files


From: ELPA Syncer
Subject: [elpa] externals/vc-got d346ca6 084/145: ignore ignored files
Date: Thu, 9 Sep 2021 15:58:39 -0400 (EDT)

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

    ignore ignored files
    
    closes #12
    
    The rationale is that `got status` doesn't print the status of the
    file if it is either up-to-date or ignored by .gitignore or
    .cvsignore.  Thus, we were marking as up-to-date the ignored files in
    *vc-dir*.  (vc-got-state was working as expected.)
    
    This tries to fix the situation.  File for which `got status` doesn't
    print any info are saved in a double-check list, and we issue a second
    `got status` only against the double check list, and push onto res
    only the up-to-date ones.
---
 vc-got.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 3dec6b9..a38a5da 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -420,16 +420,25 @@ files on disk."
 The builded result is given to the callback UPDATE-FUNCTION.  If
 FILES is nil, consider all the files in DIR."
   (let* ((fs (vc-got--dir-filter-files (or files (directory-files dir))))
-         (res (vc-got--status nil dir files)))
+         ;; XXX: we call with files, wich will probably be nil on the
+         ;; first run, so we catch deleted, missing and edited files
+         ;; in subdirectories.
+         (res (vc-got--status nil dir files))
+         double-check)
     (cl-loop for file in fs
              do (when (and (not (cdr (assoc file res #'string=)))
                            (not (file-directory-p file))
                            ;; if file doesn't exists, it's a
                            ;; untracked file that was removed.
                            (file-exists-p file))
-                  (push (list file 'up-to-date nil)
-                        res))
-             finally (funcall update-function res nil))))
+                  ;; if we don't know the status of a file here, it's
+                  ;; either up-to-date or ignored.  Save it for a
+                  ;; double check
+                  (push file double-check)))
+    (cl-loop for (file status _) in (vc-got--status nil dir double-check)
+             unless (eq status 'unregistered)
+             do (push (list file 'up-to-date nil) res))
+    (funcall update-function res nil)))
 
 (defun vc-got-dir-extra-headers (dir)
   "Return a string for the `vc-dir' buffer heading for directory DIR."



reply via email to

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