emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/logview 8ff518328f 172/259: Add a simplistic but useful Gi


From: ELPA Syncer
Subject: [nongnu] elpa/logview 8ff518328f 172/259: Add a simplistic but useful Git hook.
Date: Fri, 31 Jan 2025 07:02:09 -0500 (EST)

branch: elpa/logview
commit 8ff518328fd064b15a67c6d92bbb17b89fa1419e
Author: Paul Pogonyshev <pogonyshev@gmail.com>
Commit: Paul Pogonyshev <pogonyshev@gmail.com>

    Add a simplistic but useful Git hook.
---
 githooks/pre-commit | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/githooks/pre-commit b/githooks/pre-commit
new file mode 100755
index 0000000000..3efc31e9e5
--- /dev/null
+++ b/githooks/pre-commit
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# This can be used in a comment as a reminder to self.
+git diff-index --cached -S "DONOTCOMMIT" HEAD --patch --exit-code ":!githooks" 
\
+    || { echo; echo "Have you forgotten about the “DONOTCOMMIT”?"; exit 1; }
+
+# Eldev functions can be used during development, but must not be committed.
+git diff-index --cached -S "eldev-" HEAD --patch --exit-code ":!githooks" 
":!Eldev" \
+    || { echo; echo "Don't commit code relying on Eldev!"; exit 1; }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]