From: Shane Jaroch Date: Sat, 17 Jan 2026 05:17:52 +0000 (-0500) Subject: fixes/lint. tidy up. polish up. X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=0abdfca9c407ae9db3c0cd8fcfc1688a54fff160;p=gamesguru%2Fgit-remote-gcrypt.git fixes/lint. tidy up. polish up. --- diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 867acc6..eb63f24 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -100,8 +100,8 @@ jobs: - name: Install dependencies run: pkg update && pkg install -y git make - - name: Run your test script - run: ./my-test-script.sh + - name: Run verification + run: make check/install # Lint job lint: diff --git a/Makefile b/Makefile index 089c93d..f3cb385 100644 --- a/Makefile +++ b/Makefile @@ -212,7 +212,7 @@ install/user: ##H make install prefix=~/.local .PHONY: check/install check/install: ##H Verify installation works - bash ./tests/installer-test-verify.sh + bash ./tests/verify-system-install.sh .PHONY: uninstall/, uninstall diff --git a/completions/gen_docs.sh b/completions/gen_docs.sh index 0608a91..a635500 100755 --- a/completions/gen_docs.sh +++ b/completions/gen_docs.sh @@ -39,12 +39,20 @@ COMMANDS_LIST=$(echo "$RAW_HELP" | awk '/^ [a-z]+ / {print $1}' | grep -vE "^(h # Text: " clean -f, --force Actually delete files..." # We want to extract flags properly. # Get lines, then extract words starting with - +# Stop at the first word that doesn't start with - (description start) CLEAN_FLAGS_RAW=$(echo "$RAW_HELP" | grep "^ clean -" | awk '{ out="" - if ($2 ~ /^-/) out=$2 - if ($3 ~ /^-/) out=out " " $3 + for (i=2; i<=NF; i++) { + if ($i ~ /^-/) { + # remove comma if present + sub(",", "", $i) + out = out ? out " " $i : $i + } else { + break + } + } print out -}' | sed 's/,//g') +}') CLEAN_FLAGS_BASH=$(echo "$CLEAN_FLAGS_RAW" | tr '\n' ' ' | sed 's/ */ /g; s/ $//') @@ -56,19 +64,35 @@ echo "$CLEAN_FLAGS_RAW" | while read -r line; do # line is "-f --force" or "--hard" # simple split flags=$(echo "$line" | tr ' ' '\n') - # Build exclusion list - excl="($line)" - # Build flag list + # Build exclusion list (all flags in this group exclude each other self, but wait, + # usually -f and --force are the same. + # The user wants: '(-f --force)'{-f,--force}'[desc]' + + # Check if we have multiple flags (aliases) if echo "$line" | grep -q " "; then - # multiple flags - fspec="{$line}" - fspec=$(echo "$fspec" | sed 's/ /,/g') + # "(-f --force)" + excl="($line)" + # "{-f,--force}" + fspec="{$(echo "$line" | sed 's/ /,/g')}" else + # "" (no exclusion needed against itself strictly, or just empty for single) + # But usually clean flags are distinct. + excl="" fspec="$line" fi - # Description - just generic + + # Description - specific descriptions would be better, but generic for now. + # We rely on the fact that these are clean flags. + desc="[Flag]" + # Use printf to avoid newline issues in variable - printf " '%s'${fspec}'[flag]'" "$excl" + # Note: Zsh format is 'exclusion:long:desc' or 'exclusion'flag'desc' + # '(-f --force)'{-f,--force}'[Actually delete files]' + if [ -n "$excl" ]; then + printf " '%s'%s'%s'" "$excl" "$fspec" "$desc" + else + printf " %s'%s'" "$fspec" "$desc" + fi done >.zsh_flags_tmp CLEAN_FLAGS_ZSH=$(cat .zsh_flags_tmp) rm .zsh_flags_tmp diff --git a/tests/broken-test-gc.sh b/tests/broken-test-gc.sh index 1562cf4..cb0d14a 100755 --- a/tests/broken-test-gc.sh +++ b/tests/broken-test-gc.sh @@ -68,7 +68,7 @@ $GIT commit -m "Clean history" >/dev/null print_info "Force pushing with GCRYPT_FULL_REPACK=1..." export GCRYPT_FULL_REPACK=1 # We need to force push to overwrite the old master -if git push --force origin clean-history:master >push.log 2>&1; then +if $GIT push --force origin clean-history:master >push.log 2>&1; then print_success "Push successful" cat push.log else diff --git a/tests/manual_test_clean_local.sh b/tests/manual_test_clean_local.sh index 13100db..2e37140 100755 --- a/tests/manual_test_clean_local.sh +++ b/tests/manual_test_clean_local.sh @@ -55,6 +55,8 @@ done exec gpg "\${args[@]}" EOF chmod +x "${GNUPGHOME}/gpg" +# VIOLATION FIX: Add wrapper to PATH so it's actually used +export PATH="${GNUPGHOME}:$PATH" # Generate key echo "Generating GPG key..." @@ -69,8 +71,8 @@ git remote add origin "gcrypt::$REMOTE_DIR" git config remote.origin.gcrypt-participants "test@test.com" git config remote.origin.gcrypt-signingkey "test@test.com" -# Configure global git for test to avoid advice noise -git config --global advice.defaultBranchName false +# Configure local git for test (VIOLATION FIX: Removed --global) +git config advice.defaultBranchName false export PATH="$PROJECT_ROOT:$PATH" diff --git a/tests/system-test-clean-repack.sh b/tests/system-test-clean-repack.sh index acc1853..8491ddc 100755 --- a/tests/system-test-clean-repack.sh +++ b/tests/system-test-clean-repack.sh @@ -46,9 +46,9 @@ chmod +x "${GNUPGHOME}/gpg" # Git config isolation export GIT_CONFIG_SYSTEM=/dev/null export GIT_CONFIG_GLOBAL="$TEST_DIR/gitconfig" -git config --global user.email "test@test.com" -git config --global user.name "Test" -git config --global init.defaultBranch "master" +git config user.email "test@test.com" +git config user.name "Test" +git config init.defaultBranch "master" echo "Generating GPG key..." gpg --batch --passphrase "" --quick-generate-key "Test " diff --git a/tests/installer-test-verify.sh b/tests/verify-system-install.sh similarity index 100% rename from tests/installer-test-verify.sh rename to tests/verify-system-install.sh