Some adds

This commit is contained in:
2026-01-12 11:54:10 +01:00
parent 878aee5690
commit 876194e91b
3 changed files with 40 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
# git-refresh initialization hook
#
# You can use the following variables in this file:
# * $package package name
# * $path package path
# * $dependencies package dependencies
# Timeout in seconds before allowing another git pull (default: 15 minutes)
set -q GIT_REFRESH_TIMEOUT; or set -g GIT_REFRESH_TIMEOUT 900
function git-refresh --on-variable PWD \
--description "git pull automatically wherever inside a git repository"
test -d .git; or return
set --local fetch_head .git/FETCH_HEAD
if test -f $fetch_head
set --local age (math (date +%s) - (stat -c %Y $fetch_head 2>/dev/null; or stat -f %m $fetch_head))
if test $age -lt $GIT_REFRESH_TIMEOUT
echo -e "\e[1m(git-refresh) - Cooldown: "(math $GIT_REFRESH_TIMEOUT - $age)"s remaining\e[0m"
return
end
end
echo -e "\e[1m(git-refresh) - GIT repo detected\e[0m"
git pull --all --verbose
end