wip
authorShane Jaroch <chown_tee@proton.me>
Sat, 17 Jan 2026 04:50:22 +0000 (23:50 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 17 Jan 2026 04:50:22 +0000 (23:50 -0500)
Makefile
README.rst
completions/fish/git-remote-gcrypt.fish
completions/gen_docs.sh
completions/templates/README.rst.in
completions/zsh/_git-remote-gcrypt

index 02c51283e521bb9183bf7ced792e69b7e52f918b..6349c403350307b11af8870a5ac7cf3d9c332317 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -108,8 +108,10 @@ test/:     ##H Run tests (purity checks only if kcov missing)
 .PHONY: test/installer
 test/installer:        ##H Test installer logic
        @rm -rf $(COV_INSTALL)
-       @mkdir -p $(COV_INSTALL)
+       @mkdir -p $(COV_INSTALL) .tmp
+       @rm -f .tmp/kcov.log
        @export COV_DIR=$(COV_INSTALL); \
+        set -o pipefail; \
         for test_script in tests/installer-test*.sh; do \
             if [ "$$test_script" = "tests/installer-test-logic.sh" ]; then \
                 kcov --bash-dont-parse-binary-dir \
index b34465db245f1bd0e4da710629fe9123f38c4df4..e9dcabd40e1cc1b401f41ec812f6cce15a2b20d8 100644 (file)
@@ -61,7 +61,7 @@ Command Reference
       check [URL]      Check if URL is a gcrypt repository
       clean [URL|REMOTE] Scan/Clean unencrypted files from remote
         clean --force        Actually delete files (default is scan only)
-        clean --init         Allow cleaning valid files (requires --force)
+        clean --init         Allow cleaning uninitialized repos (requires --force)
         clean --hard         Override safety checks (requires --force)
       stat [URL|REMOTE] Show diagnostics (file counts, tracked vs untracked)
     Git Protocol Commands (for debugging):
@@ -73,6 +73,7 @@ Command Reference
     Environment Variables:
       GCRYPT_DEBUG=1        Enable verbose debug logging to stderr
       GCRYPT_TRACE=1        Enable shell tracing (set -x) for rsync/curl commands
+      GCRYPT_FULL_REPACK=1  Force full repack when pushing
 
 Configuration
 =============
@@ -312,7 +313,7 @@ If no URL or remote is specified, ``git-remote-gcrypt`` will list all
 available ``gcrypt::`` remotes.
 
 By default, this command only performs a scan. To actually remove the
-unencrypted files, you must use the ``--force`` (or ``-f``) flag::
+unencrypted files, you must use the ``--force`` flag::
 
     git-remote-gcrypt clean url --force
 
index bdb8d42f4aa392ba3d5d7be567a680245134e591..9b86f70e80a0876f743cb71d1ed8aab86714301f 100644 (file)
@@ -13,6 +13,7 @@ complete -c git-remote-gcrypt -n "__fish_seen_subcommand_from check" -a "(git re
 complete -c git-remote-gcrypt -n "__fish_seen_subcommand_from stat" -a "(git remote 2>/dev/null)" -d 'Git Remote'
 
 # Clean flags
-complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l force -d 'Flag'
-complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l init -d 'Flag'
-complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l hard -d 'Flag'
+complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -s -force -l  -d 'Flag';
+complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -s -init -l  -d 'Flag';
+complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -s -hard -l  -d 'Flag';
+
index 93b2a921e01bbafc939a891d34db25c32fbb8824..4e03f2998ac71493af3eab09cca76f79443697ae 100755 (executable)
@@ -37,20 +37,39 @@ COMMANDS_LIST=$(echo "$RAW_HELP" | awk '/^  [a-z]+ / {print $1}' | grep -vE "^(h
 
 # Extract clean flags
 # Text: "    clean -f, --force    Actually delete files..."
-# We want: "-f --force -i --init" for Bash
-CLEAN_FLAGS_RAW=$(echo "$RAW_HELP" | grep "^    clean -" | awk '{print $2, $3}' | sed 's/,//g')
-CLEAN_FLAGS_BASH=$(echo "$CLEAN_FLAGS_RAW" | tr '\n' ' ' | sed 's/ $//')
+# We want to extract flags properly.
+# Get lines, then extract words starting with -
+CLEAN_FLAGS_RAW=$(echo "$RAW_HELP" | grep "^    clean -" | awk '{
+       out=""
+       if ($2 ~ /^-/) out=$2
+       if ($3 ~ /^-/) out=out " " $3
+       print out
+}' | sed 's/,//g')
 
-# For Zsh: we want simple list for now as per plan, user asked for dynamic but safe.
-# Constructing a simple list of flags requires parsing.
-# The previous python script just injected them.
+CLEAN_FLAGS_BASH=$(echo "$CLEAN_FLAGS_RAW" | tr '\n' ' ' | sed 's/  */ /g; s/ $//')
+
+# For Zsh: Generate proper spec strings
 CLEAN_FLAGS_ZSH=""
-# We'll just provide the flags as a list for _arguments
-# ZSH format roughly: '(-f --force)'{-f,--force}'[desc]'
-# Let's simplify and just pass the flags for now to match the user's "native completion" request without over-engineering the parsing in shell.
-# We will just list them.
-COMMA_FLAGS=$(echo "$CLEAN_FLAGS_BASH" | tr ' ' ',')
-CLEAN_FLAGS_ZSH="'(${CLEAN_FLAGS_BASH})' {${COMMA_FLAGS}} '[flag]'"
+IFS="
+"
+for line in $CLEAN_FLAGS_RAW; do
+       # line is "-f --force" or "--hard"
+       # simple split
+       flags=$(echo "$line" | tr ' ' '\n')
+       # Build exclusion list
+       excl="($line)"
+       # Build flag list
+       if echo "$line" | grep -q " "; then
+               # multiple flags
+               fspec="{$line}"
+               fspec=$(echo "$fspec" | sed 's/ /,/g')
+       else
+               fspec="$line"
+       fi
+       # Description - we could extract it but for now generic
+       CLEAN_FLAGS_ZSH="${CLEAN_FLAGS_ZSH} '${excl}'${fspec}'[flag]'"
+done
+unset IFS
 
 # For Fish
 # We need to turn "-f, --force" into:
index 67b6ef8fe9f75dab644f94043f1438b3b7ecd93c..e270963009df76286a4b02932ba39888c8177a35 100644 (file)
@@ -295,7 +295,7 @@ If no URL or remote is specified, ``git-remote-gcrypt`` will list all
 available ``gcrypt::`` remotes.
 
 By default, this command only performs a scan. To actually remove the
-unencrypted files, you must use the ``--force`` (or ``-f``) flag::
+unencrypted files, you must use the ``--force`` flag::
 
     git-remote-gcrypt clean url --force
 
index 0b86da0044c54f27b32ecc09f93487cdaaa465ea..29845ea01eedd56945d287dfae26c90b0155d4fc 100644 (file)
@@ -14,7 +14,7 @@ _git_remote_gcrypt() {
 
        case $line[1] in
        clean)
-               _arguments '(--force --init --hard)'{--force,--init,--hard}'[flag]' \
+               _arguments  '(--force)'--force'[flag]' '(--init)'--init'[flag]' '(--hard)'--hard'[flag]' \
                        '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"'
                ;;
        check | stat)