summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md22
-rw-r--r--config.org19
2 files changed, 41 insertions, 0 deletions
diff --git a/README.md b/README.md
index 76bfe16..149ebe2 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,7 @@ The current setup uses these packages and built-in modules:
- `org` and `org-capture` for agenda, capture, daily notes, and the literate configuration itself.
- `denote` for durable notes, naming, keywords, and linking.
+- `git-auto-commit-mode` for automatic note commits on save inside the notes repo.
- `vertico` for minibuffer completion UI.
- `orderless` for flexible completion matching.
- `marginalia` for minibuffer annotations.
@@ -109,6 +110,27 @@ Denote handles long-lived notes. The main bindings are:
Keyword prompts and directory placement are part of the workflow, not an afterthought. The config is set up so structure is created first, then capture writes into it.
+### Automatic note commits
+
+The notes tree can opt into `git-auto-commit-mode` through a directory-local file at `~/org/.dir-locals.el`. In the current setup, the Emacs config installs the package and configures shell command chaining based on the active shell, while the notes repository carries its own auto-commit policy in directory locals.
+
+When enabled for the notes tree, saving a file in `~/org/` makes Emacs try to commit that change to the notes repository. In the current `~/org/.dir-locals.el`, new files are added automatically, commits are debounced by 60 seconds, automatic pushing is enabled, and the default commit message is a timestamp in the form `Auto-commit: YYYY-MM-DD HH:MM:SS`.
+
+Place this file at the root of the notes repository:
+
+```emacs-lisp
+((nil . ((eval . (progn
+ (setq-local gac-automatically-add-new-files-p t
+ gac-automatically-push-p t
+ gac-debounce-interval 60
+ gac-default-message
+ (lambda (_filename)
+ (format-time-string "Auto-commit: %Y-%m-%d %H:%M:%S")))
+ (git-auto-commit-mode 1))))))
+```
+
+That applies to buffers visiting files under `~/org/` and its subdirectories. The repository-local settings control whether new files are added, whether pushes occur, how long commits are debounced, and what commit message is used, while the Emacs config supplies the package itself and picks the correct shell command separator for the active shell.
+
### Terminal and GUI behavior
GUI Emacs and terminal Emacs are handled slightly differently.
diff --git a/config.org b/config.org
index a24c983..f1cff0d 100644
--- a/config.org
+++ b/config.org
@@ -608,6 +608,25 @@ Denote handles naming, metadata, linking, and retrieval.
(denote-rename-buffer-mode 1))
#+end_src
+** Automatic git commits
+
+The notes tree can enable =git-auto-commit-mode= through a =.dir-locals.el=
+at =~/org/=. The Emacs config keeps the package available and sets the
+machine-specific shell command chaining based on the active shell, while the
+repo-local behavior lives with the notes tree.
+
+#+begin_src emacs-lisp
+ (use-package git-auto-commit-mode
+ :ensure t
+ :pin melpa
+ :commands (git-auto-commit-mode)
+ :init
+ (setq gac-shell-and
+ (if (string-match-p "fish\\'" shell-file-name)
+ " ; and "
+ " && ")))
+#+end_src
+
* Gptel workflow
This keeps LLM chat available as a small workflow tool inside Emacs. GitHub