diff options
author | Kyle Meyer <kyle@kyleam.com> | 2022-12-10 01:51:46 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2022-12-10 02:18:08 -0500 |
commit | 6b0a3ecd874b8f724707837f05278300c981dfd3 (patch) | |
tree | 86e522c981f9cd638650490c80dee334ea4b3fed | |
parent | 4dcb1a1ffa2711ca267ce8c306c9da20f3a3b41c (diff) | |
download | orgmode-backport-notes-6b0a3ecd874b8f724707837f05278300c981dfd3.tar.gz |
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.
-rw-r--r-- | org-maint.el | 15 |
1 files 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)) |