alexluigit / dirvish

A polished Dired with batteries included.
GNU General Public License v3.0
795 stars 44 forks source link

Unexpected `git log` processes #162

Open d1egoaz opened 1 year ago

d1egoaz commented 1 year ago

Thank you for the bug report

Bug description

After opening dirvish-side and opening a file, my systems gets literally hundred of these processes. It causes Emacs to get unresponsive.

  501 12910 12015   0 10:43AM ttys038    0:00.02 /opt/homebrew/Cellar/emacs-plus@29/29.0.50/Emacs.app/Contents/MacOS/Emacs -Q -batch --eval (message "%s" (with-temp-buffer (let ((hash (make-hash-table)) (bk nil)) (dolist (file (directory-files "/Users/xxx/src/yyy" t nil t)) (let* ((attrs (file-attributes file)) (state (and bk (vc-state-refresh file bk))) (git (and (eq bk 'Git) (shell-command-to-string (format "git log -1 --pretty=%%s %s" (shell-quote-argument file))))) (tp (nth 0 attrs))) (cond ((eq t tp) (setq tp '(dir))) (tp (setq tp `(,(if (file-directory-p tp) 'dir 'file) \, tp))) (t (setq tp '(file)))) (puthash (intern (secure-hash 'md5 file)) `(:builtin ,attrs :type ,tp ,@(and state (list :vc-state state)) ,@(and git (list :git-msg git))) hash))) (prin1 (cons bk hash) (current-buffer))) (buffer-substring-no-properties (point-min) (point-max))))

Steps to reproduce

(use-package dirvish
  :init
  (dirvish-override-dired-mode)
  :config

  (setq dirvish-attributes '(all-the-icons))
  (setq dirvish-preview-dispatchers nil)
  (setq delete-by-moving-to-trash t)
  (setq dirvish-use-header-line nil)
  (setq dirvish-use-mode-line nil)
  (setq dired-listing-switches "-l --almost-all --human-readable --group-directories-first --no-group")
  (dirvish-side-follow-mode 1))

Expected behavior

No spawned processes

OS

MacOS

Emacs Version

gccemacs-29

Emacs Configurations

Vanilla

Error callstack

No response

Anything else

No response

d1egoaz commented 1 year ago

I'm not sure why it's trying to get VC information if I thought I disabled that by removing it from the attributes variable.

I think the issue might be here, but not sure TBH https://github.com/alexluigit/dirvish/blob/ec4100612b2e93d9e188e7eab4c144b45f3547ee/dirvish.el#L1103-L1108

alexluigit commented 1 year ago

Hi @d1egoaz , thanks for your report. This is indeed an issue caused by the excerpt you posted. Ideally, the git log command part here should belong to dirvish-vc.el, the reason I left it here is that for now dirvish doesn't have an interface for async data-fetching. I'll fix it soon.

Cletip commented 2 months ago

Hello,

Just to let you know that I have the same error. Has anyone found a solution? Dirvish is really great!

Thanks in advance for your reply