Skip to content

fix op/category-ignore-list just not display, #190 #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion op-git.el
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ instead of pointer HEAD."
(output (git-run "ls-tree" "-r" "--name-only"
(or branch "HEAD"))))
(--map (expand-file-name it repo-dir)
(--filter (not (validate-ignore-categories it))
(--filter (string-suffix-p org-file-ext it t)
(split-string output "\n")))))
(split-string output "\n"))))))

(defun op/git-branch-name (repo-dir)
"Return name of current branch of git repository presented by REPO-DIR."
Expand Down
11 changes: 11 additions & 0 deletions op-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ alternative to `ht-from-plist'."
(value (cadr pair)))
(ht-set h key value)))))

(defun validate-ignore-categories (file)
(if op/category-config-alist
(let ((rst nil)
(len (length op/category-ignore-list)))
(while (> len 0)
(setq len (- len 1))
(when (string-prefix-p (nth len op/category-ignore-list) file)
(setq len 0)
(setq rst t)))
rst)))


(provide 'op-util)

Expand Down