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

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

[nongnu] elpa/hyperdrive 88c9e0fe85 6/7: Fix: (tracked-hooks/pre-commit)


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 88c9e0fe85 6/7: Fix: (tracked-hooks/pre-commit) Only export .texi if .org is staged
Date: Thu, 19 Oct 2023 22:00:33 -0400 (EDT)

branch: elpa/hyperdrive
commit 88c9e0fe85f240f4db81b589770d0082e534a664
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Fix: (tracked-hooks/pre-commit) Only export .texi if .org is staged
    
    Also, only exit non-zero when .org is staged but .texi is unstaged.
---
 tracked-hooks/pre-commit | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tracked-hooks/pre-commit b/tracked-hooks/pre-commit
index edb66f9d58..9cc8781b66 100755
--- a/tracked-hooks/pre-commit
+++ b/tracked-hooks/pre-commit
@@ -1,11 +1,17 @@
 #!/bin/bash
 
-make doc
-
-if [[ $(git status --porcelain -- doc/hyperdrive.texi) ]]
+if git status --porcelain -- doc/hyperdrive.org | grep "^M" > /dev/null
 then
-    echo "hyperdrive.texi may need to be added"
-    exit 1
+    # hyperdrive.org has staged changes
+    make doc
+    if git status --porcelain -- doc/hyperdrive.texi | grep "^ M" > /dev/null
+    then
+        # After export, hyperdrive.texi has unstaged changes
+        echo "hyperdrive.texi may need to be added"
+        exit 1
+    else
+        exit 0
+    fi
 else
     exit 0
 fi



reply via email to

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