hooks: rename sparse-checkout.sh to enable-sparse-checkout.sh
authorAntonio Ospite <ao2@ao2.it>
Thu, 24 Jan 2019 14:51:31 +0000 (15:51 +0100)
committerAntonio Ospite <ao2@ao2.it>
Thu, 31 Jan 2019 08:30:16 +0000 (09:30 +0100)
Rename the sparse-checkout.sh script to enable-sparse-checkout.sh to
better illustrate what the script actually does.

In particular the new name should communicate that the script does not
update the working tree itself but it just enable sparse checkout
support, leaving the working tree update to other git commands
(read-tree, checkout, etc.).

.config/vcsh/hooks-available/enable-sparse-checkout.sh [new file with mode: 0755]
.config/vcsh/hooks-available/populate-sparsely.sh
.config/vcsh/hooks-available/sparse-checkout.sh [deleted file]
.config/vcsh/hooks-enabled/pre-upgrade.00-sparse-checkout

diff --git a/.config/vcsh/hooks-available/enable-sparse-checkout.sh b/.config/vcsh/hooks-available/enable-sparse-checkout.sh
new file mode 100755 (executable)
index 0000000..2ebf5a5
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+# If the vcsh repository does not exist, exit without doing anything.
+[ -d "$GIT_DIR" ] || exit 0
+
+: "${XDG_CONFIG_HOME:="$HOME/.config"}"
+
+git config core.sparseCheckout true
+rm -f "$GIT_DIR/info/sparse-checkout"
+ln -s "$XDG_CONFIG_HOME/vcsh/sparse-checkout" "$GIT_DIR/info/sparse-checkout"
index 0561add..937122a 100755 (executable)
@@ -17,7 +17,7 @@ LOCKPID=$(cat "$LOCKDIR/pid")
 : "${XDG_CONFIG_HOME:="$HOME/.config"}"
 
 # shellcheck source=/dev/null
 : "${XDG_CONFIG_HOME:="$HOME/.config"}"
 
 # shellcheck source=/dev/null
-. "$XDG_CONFIG_HOME/vcsh/hooks-available/sparse-checkout.sh"
+. "$XDG_CONFIG_HOME/vcsh/hooks-available/enable-sparse-checkout.sh"
 
 # Verify if the current branch is valid before updating the working tree.
 # This avoids errors with empty repositories which would only confuse the
 
 # Verify if the current branch is valid before updating the working tree.
 # This avoids errors with empty repositories which would only confuse the
diff --git a/.config/vcsh/hooks-available/sparse-checkout.sh b/.config/vcsh/hooks-available/sparse-checkout.sh
deleted file mode 100755 (executable)
index 2ebf5a5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# If the vcsh repository does not exist, exit without doing anything.
-[ -d "$GIT_DIR" ] || exit 0
-
-: "${XDG_CONFIG_HOME:="$HOME/.config"}"
-
-git config core.sparseCheckout true
-rm -f "$GIT_DIR/info/sparse-checkout"
-ln -s "$XDG_CONFIG_HOME/vcsh/sparse-checkout" "$GIT_DIR/info/sparse-checkout"
index 2a2ca43..689d439 120000 (symlink)
@@ -1 +1 @@
-../hooks-available/sparse-checkout.sh
\ No newline at end of file
+../hooks-available/enable-sparse-checkout.sh
\ No newline at end of file