From 6b0a3ecd874b8f724707837f05278300c981dfd3 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 10 Dec 2022 01:51:46 -0500 Subject: org-maint-check-for-new: Take optional ref to exclude from property As a described a few commits back, using org-maint-check-for-new for master and an emacs-NN branch at the same time leads to repeated entries between the two headings. Add support for specifying an exclude-ref property that can be used to remove emacs-NN from master's output. --- org-maint.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/org-maint.el b/org-maint.el index 71b9d31..df80256 100644 --- a/org-maint.el +++ b/org-maint.el @@ -65,14 +65,21 @@ If APPLY is non-nil, use 'git apply' instead of 'git am'." (defun org-maint-check-for-new () "Check for new commits in the Emacs repository to port. + Determine \"new\" commits by looking for commits that 1) touch Org files, 2) are contained in the Emacs reference specified by the Org \"ref\" property, and 3) are _not_ included in the -revision returned by `org-maint-rev-from-next-item'." +revision returned by `org-maint-rev-from-next-item'. + +If a reference is specified by the Org property \"exclude-ref\", +don't consider commits contained in this reference new." (interactive) - (let ((revs (list (or (org-entry-get (point) "ref") - (user-error "No reference found")) - (concat "^" (org-maint-rev-from-next-item)))) + (let ((revs (nconc + (list (or (org-entry-get (point) "ref") + (user-error "No reference found")) + (concat "^" (org-maint-rev-from-next-item))) + (and-let* ((ex-ref (org-entry-get (point) "exclude-ref"))) + (list (concat "^" ex-ref))))) (default-directory org-maint-emacs-dir)) (with-current-buffer (get-buffer-create "*org-maint-new-entries*") (goto-char (point-min)) -- cgit v1.2.3