aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile17
-rw-r--r--README9
-rw-r--r--annexview-tests.el58
-rw-r--r--annexview.el13
4 files changed, 56 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index c09861c..b5da515 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,17 @@
-include config.mk
+COMPAT_DIR ?= /dev/null
DASH_DIR ?= /dev/null
-GHUB_DIR ?= /dev/null
WITH_EDITOR_DIR ?= /dev/null
-MAGIT_POPUP_DIR ?= /dev/null
+TRANSIENT_DIR ?= /dev/null
MAGIT_DIR ?= /dev/null
-EMACSBIN ?= emacs
+EMACS ?= emacs
-LOAD_PATH = -L $(DASH_DIR) -L $(WITH_EDITOR_DIR) -L $(GHUB_DIR) \
- -L $(MAGIT_POPUP_DIR) -L $(MAGIT_DIR)
-BATCH = $(EMACSBIN) -Q --batch $(LOAD_PATH)
+LOAD_PATH = -L $(COMPAT_DIR) -L $(DASH_DIR) -L $(WITH_EDITOR_DIR) \
+ -L $(TRANSIENT_DIR) -L $(MAGIT_DIR)
+BATCH = $(EMACS) -Q --batch $(LOAD_PATH)
all: annexview.elc annexview-autoloads.el
@@ -30,4 +30,7 @@ clean:
%-autoloads.el: %.el
@$(BATCH) --eval \
"(let ((make-backup-files nil)) \
- (update-file-autoloads \"$(CURDIR)/$<\" t \"$(CURDIR)/$@\"))"
+ (if (fboundp 'loaddefs-generate) \
+ (loaddefs-generate default-directory \"$@\" \
+ (list \"annexview-tests.el\")) \
+ (update-file-autoloads \"$(CURDIR)/$<\" t \"$(CURDIR)/$@\")))"
diff --git a/README b/README
index 31cd77e..6f2bcc7 100644
--- a/README
+++ b/README
@@ -7,6 +7,15 @@ commentary more details.
[^2]: https://git-annex.branchable.com/tips/metadata_driven_views/
+Status: hibernating
+-------------------
+
+The core functionality I had in mind is in place, but there are a lot
+of little bits left to do. The main problem is that I don't actually
+use git-annex views! I think metadata-driven views sound great and
+exciting. But that hasn't been enough to get me to actually use them.
+
+
Contributing
------------
diff --git a/annexview-tests.el b/annexview-tests.el
index cbf4d08..3770a4c 100644
--- a/annexview-tests.el
+++ b/annexview-tests.el
@@ -91,7 +91,7 @@
(annexview-with-test-repo
(should (equal (annexview-string-sort (annexview-field-names))
(list "f" "tag" "year")))
- (should (equal (annexview-field-names (list "bar"))
+ (should (equal (annexview-string-sort (annexview-field-names (list "bar")))
(list "f" "year")))))
(ert-deftest annexview-field-values ()
@@ -102,7 +102,7 @@
(annexview-field-values "year" (list "foo")))
(list "2017")))))
-(ert-deftest annexview-field-values ()
+(ert-deftest annexview-tags ()
(annexview-with-test-repo
(should (equal (annexview-string-sort (annexview-tags))
(list "foo-tag0" "foo-tag1")))
@@ -169,29 +169,31 @@
(ert-deftest annexview-views ()
(annexview-with-test-repo
- (annexview-create-view (list "year=*"))
- (should (file-exists-p "2017"))
- (should (file-exists-p "2018"))
- ;; vpop
- (annexview-vpop)
- (should-not (file-exists-p "2017"))
- (should-not (file-exists-p "2018"))
- ;; vcycle
- (annexview-create-view (list "tag=*" "year=*"))
- (should (equal (annexview-string-sort (annexview-views))
- (list "tag=_;year=_" "year=_")))
- (should (file-exists-p "foo-tag0"))
- (should (file-exists-p "foo-tag1"))
- (annexview-vcycle)
- (should (file-exists-p "2017"))
- (should (file-exists-p "2017/foo-tag0"))
- ;; vfilter
- (annexview-create-view (list "year=*"))
- (annexview-vfilter (list "tag=foo-tag0"))
- (should (file-exists-p "2017"))
- (should-not (file-exists-p "2018"))
- ;; vadd
- (annexview-create-view (list "tag=*"))
- (annexview-vadd (list "year=*"))
- (should (file-exists-p "2017"))
- (should (file-exists-p "2017/foo-tag0"))))
+ (let ((base (annexview-git-string "symbolic-ref" "--short" "HEAD")))
+ (annexview-create-view (list "year=*"))
+ (should (file-exists-p "2017"))
+ (should (file-exists-p "2018"))
+ ;; vpop
+ (annexview-vpop)
+ (should-not (file-exists-p "2017"))
+ (should-not (file-exists-p "2018"))
+ ;; vcycle
+ (annexview-create-view (list "tag=*" "year=*"))
+ (should (equal (annexview-string-sort (annexview-views))
+ (mapcar (lambda (v) (concat base "(" v ")"))
+ (list "tag=_;year=_" "year=_"))))
+ (should (file-exists-p "foo-tag0"))
+ (should (file-exists-p "foo-tag1"))
+ (annexview-vcycle)
+ (should (file-exists-p "2017"))
+ (should (file-exists-p "2017/foo-tag0"))
+ ;; vfilter
+ (annexview-create-view (list "year=*"))
+ (annexview-vfilter (list "tag=foo-tag0"))
+ (should (file-exists-p "2017"))
+ (should-not (file-exists-p "2018"))
+ ;; vadd
+ (annexview-create-view (list "tag=*"))
+ (annexview-vadd (list "year=*"))
+ (should (file-exists-p "2017"))
+ (should (file-exists-p "2017/foo-tag0")))))
diff --git a/annexview.el b/annexview.el
index 81a37fc..735bc94 100644
--- a/annexview.el
+++ b/annexview.el
@@ -90,7 +90,7 @@
(if (boundp 'magit-git-executable) magit-git-executable "git")
"Invoke git like this.
And invoke git-annex by using \"annex\" as the subcommand."
- :type 'stringp)
+ :type 'string)
;;; Metadata inspection
@@ -153,11 +153,12 @@ And invoke git-annex by using \"annex\" as the subcommand."
(if (equal annexview-git-annex-hash
(cdr (assq :hash ,cached)))
(cdr (assq :result ,cached))
- (cl-delete-if (lambda (x)
- (and (equal (car x) ,keyvar)
- (not (equal annexview-git-annex-hash
- (cdr (assq :hash x))))))
- annexview--cache)
+ (setq annexview--cache
+ (cl-delete-if (lambda (x)
+ (and (equal (car x) ,keyvar)
+ (not (equal annexview-git-annex-hash
+ (cdr (assq :hash x))))))
+ annexview--cache))
(let ((,result ,(macroexp-progn body)))
(push (list ,keyvar
(cons :hash annexview-git-annex-hash)