aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2019-03-26 13:44:50 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2019-03-26 14:18:12 +0100
commit6994e6743603ab73cc32d32786a55672f4fa46f0 (patch)
treeaf20c2c347bdf0c936694acd73ce1d074d18b006
parentf95e33a7ad9afe3f5087b4d8c80731d731b08839 (diff)
downloadguix-6994e6743603ab73cc32d32786a55672f4fa46f0.tar
guix-6994e6743603ab73cc32d32786a55672f4fa46f0.tar.gz
etc: Add "rename" snippet.
* etc/snippets/text-mode/guix-commit-message-rename-package: New file.
-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