Unexpected `git log` processes
Thank you for the bug report
- [X] I am using the latest version of
dirvishrelated packages. - [X] I checked CUSTOMIZING|EXTENSIONS.
- [ ] You may also try reproduce the issue using clean environment and minimal configurations with
the command
emacs -Q.
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
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
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.
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