3 (defvar dired-omit-regexp-orig (symbol-function 'dired-omit-regexp))
5 (defun dired-omit-regexp ()
6 (let ((file (expand-file-name ".git"))
8 (while (and (not (file-exists-p file))
13 (file-name-directory file))))
14 ;; Give up if we are already at the root dir.
15 (not (string= (file-name-directory file)
17 ;; Move up to the parent dir and try again.
18 (setq file (expand-file-name ".git" parent-dir)))
19 ;; If we found a change log in a parent, use that.
20 (if (file-exists-p file)
21 (let ((regexp (funcall dired-omit-regexp-orig)))
22 (assert (stringp regexp))
25 (if (> (length regexp) 0)
33 (if (= ?/ (aref str (1- (length str))))
37 (split-string (shell-command-to-string
42 (funcall dired-omit-regexp-orig))))