From 11ab7e5afbac0c0952a5142c4f50081285d09254 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:47:37 +0300 Subject: [PATCH] Skip pre-commit hooks in the git-sync cron job --- .local/bin/hookless-git-sync | 14 ++++++++++++++ .local/bin/sync-git-repos | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .local/bin/hookless-git-sync diff --git a/.local/bin/hookless-git-sync b/.local/bin/hookless-git-sync new file mode 100755 index 0000000..c9f1f14 --- /dev/null +++ b/.local/bin/hookless-git-sync @@ -0,0 +1,14 @@ +#! /usr/bin/bash + +git () { + case "$1" in + commit) + shift + command git commit --no-verify "$@" + ;; + *) + command git "$@" + ;; + esac +} +. "$(systemd-path user-state-private)"/git-sync/git-sync "$@" diff --git a/.local/bin/sync-git-repos b/.local/bin/sync-git-repos index a30bf3c..f34f0ac 100755 --- a/.local/bin/sync-git-repos +++ b/.local/bin/sync-git-repos @@ -12,7 +12,7 @@ sync_repo () { repo=$1 echo git-sync -s "${repo}" - ( cd "${repo}" && "$(systemd-path user-state-private)"/git-sync/git-sync -s sync ) + ( cd "${repo}" && "$(systemd-path user-binaries)"/hookless-git-sync -s sync ) echo }