dont always do git lfs

This commit is contained in:
Christoph J. Scherr 2025-01-30 09:18:57 +01:00
parent d644581eb2
commit c241963f56
Signed by: PlexSheep
GPG Key ID: 9EB784BB202BB7BB
4 changed files with 10 additions and 22 deletions

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.\n"; exit 2; }
git lfs post-checkout "$@"

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit.\n"; exit 2; }
git lfs post-commit "$@"

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; }
git lfs post-merge "$@"

View File

@ -2,8 +2,9 @@
# check for WIP commits # check for WIP commits
wips=$(git log --oneline --no-decorate | grep -i wip ) wips=$(git log --oneline --no-decorate | grep -i wip )
wips_n=$(echo "$wips" | wc -l) wips_n=$(echo "$wips" | wc -l)
LOCKFILE=/tmp/githook.allow_wip LOCKFILE="$PWD/.git/.githook.allow_wip"
# This checks if neither lockfile exists AND wips is non-empty
if [[ ! -f $LOCKFILE && -n "$wips" ]]; then if [[ ! -f $LOCKFILE && -n "$wips" ]]; then
# Allows us to read user input below, assigns stdin to keyboard # Allows us to read user input below, assigns stdin to keyboard
exec < /dev/tty exec < /dev/tty
@ -14,7 +15,3 @@ if [[ ! -f $LOCKFILE && -n "$wips" ]]; then
* ) echo -e "\naborting."; exit 1;; * ) echo -e "\naborting."; exit 1;;
esac esac
fi fi
# git-lfs stuff
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
git lfs pre-push "$@"