summary refs log tree commit diff
path: root/etc/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'etc/snippets')
-rw-r--r--etc/snippets/text-mode/guix-commit-message-rename-package20
1 files changed, 20 insertions, 0 deletions
diff --git a/etc/snippets/text-mode/guix-commit-message-rename-package b/etc/snippets/text-mode/guix-commit-message-rename-package
new file mode 100644
index 0000000000..9695ca1b3d
--- /dev/null
+++ b/etc/snippets/text-mode/guix-commit-message-rename-package
@@ -0,0 +1,20 @@
+# -*- mode: snippet -*-
+# name: guix-commit-message-rename-package
+# key: rename
+# condition: git-commit-mode
+# --
+gnu: ${1:`(with-temp-buffer
+           (magit-git-wash #'magit-diff-wash-diffs
+             "diff" "--staged")
+           (beginning-of-buffer)
+           (when (search-forward "-(define-public " nil 'noerror)
+             (thing-at-point 'sexp 'no-properties)))`}: Rename package to ${2:`(with-temp-buffer
+           (magit-git-wash #'magit-diff-wash-diffs
+             "diff" "--staged")
+           (beginning-of-buffer)
+           (when (search-forward "+(define-public " nil 'noerror)
+             (thing-at-point 'sexp 'no-properties)))`}.
+
+* `(car (magit-staged-files))` ($1): Define in terms of
+'deprecated-package'.
+($2): New variable, formerly known as "$1".
\ No newline at end of file