From ce6bde63e93204f76f229e7384b29a191e4d5bf6 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 21 Dec 2025 03:50:27 +0900 Subject: created bin/ppts --- mac/.local/bin/ppts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 mac/.local/bin/ppts (limited to 'mac') diff --git a/mac/.local/bin/ppts b/mac/.local/bin/ppts new file mode 100755 index 0000000..bde60df --- /dev/null +++ b/mac/.local/bin/ppts @@ -0,0 +1,32 @@ +#!/bin/sh + +# Wrapper script for git push that handles content/ directory exclusion +# Usage: ppts [other git push options] + +remote="$1" +shift + +# Run git push +git push "$remote" "$@" +push_exit_code=$? + +# If push was successful and we pushed to origin, restore content/ +if [ "$push_exit_code" -eq 0 ] && [ "$remote" = "origin" ]; then + if [ -f .git/hooks/.pre-push-state ]; then + echo "Restoring content/ directory..." + + # Read the stored HEAD and temp commit + original_head=$(head -n 1 .git/hooks/.pre-push-state) + + # Reset to original HEAD (this will restore content/) + if [ -n "$original_head" ] && git rev-parse --verify "$original_head" >/dev/null 2>&1; then + git reset --soft "$original_head" >/dev/null 2>&1 + echo "content/ directory restored to git index" + fi + + # Clean up state file + rm -f .git/hooks/.pre-push-state + fi +fi + +exit "$push_exit_code" -- cgit v1.2.3