aboutsummaryrefslogtreecommitdiff
path: root/org-maint.el
diff options
context:
space:
mode:
Diffstat (limited to 'org-maint.el')
-rw-r--r--org-maint.el53
1 files changed, 30 insertions, 23 deletions
diff --git a/org-maint.el b/org-maint.el
index 8364133..2020f3d 100644
--- a/org-maint.el
+++ b/org-maint.el
@@ -1,6 +1,6 @@
;;; org-maint.el --- Helpers for porting Emacs commits to Org -*- lexical-binding: t; -*-
-;; Copyright (C) 2020 Kyle Meyer
+;; Copyright (C) 2020-2022 Kyle Meyer
;; Author: Kyle Meyer <kyle@kyleam.com>
@@ -21,8 +21,8 @@
(require 'org)
-(defvar org-maint-emacs-dir "~/src/emacs/emacs/")
-(defvar org-maint-org-dir "~/src/emacs/org-mode-devel/")
+(defvar org-maint-emacs-dir "~/src/savannah/emacs/")
+(defvar org-maint-org-dir "~/src/savannah/org-mode--ports/")
(defun org-maint-apply-emacs-commit (commit &optional apply)
"Apply COMMIT from `org-maint-emacs-dir' to `org-maint-org-dir'.
@@ -64,31 +64,38 @@ If APPLY is non-nil, use 'git apply' instead of 'git am'."
(user-error "Next revision item not found"))))
(defun org-maint-check-for-new ()
- "Check for new commits to backport.
-The last commit found is assumed to be the return value of
-`org-maint-rev-from-next-item', and Emacs ref name that should be
-checked is taken from the Org \"ref\" property."
+ "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'.
+
+If a reference is specified by the Org property \"exclude-ref\",
+don't consider commits contained in this reference new."
(interactive)
- (let ((ref (or (org-entry-get (point) "ref")
- (user-error "No reference found")))
- (last-rev (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))
(erase-buffer)
- (insert (format ";; %s..%s\n\n" last-rev ref))
- (call-process "git" nil t nil
- "log" "--oneline"
- "--format=- [ ] %H%n%n %s%n %an%n %cd%n"
- (concat "^" last-rev) ref
- "--"
- "doc/misc/org.texi"
- "etc/ORG-NEWS"
- "etc/org"
- "etc/refcards/orgcard.tex"
- "etc/schema/od-manifest-schema-v1.2-os.rnc"
- "etc/schema/od-schema-v1.2-os.rnc"
- "lisp/org")
+ (insert (format ";; revisions: %S\n\n" revs))
+ (apply #'call-process "git" nil t nil
+ "log" "--oneline" "--format=- [ ] %H%n%n %s%n %an%n %cd%n"
+ (nconc revs
+ (list "--"
+ "doc/misc/org.org"
+ "doc/misc/org-setup.org"
+ "etc/ORG-NEWS"
+ "etc/org"
+ "etc/refcards/orgcard.tex"
+ "etc/schema/"
+ "lisp/org")))
(display-buffer (current-buffer)))))
(provide 'org-maint)