add compatibility workflow; fix format
authorShane Jaroch <chown_tee@proton.me>
Sat, 17 Jan 2026 08:04:59 +0000 (03:04 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 17 Jan 2026 08:04:59 +0000 (03:04 -0500)
.github/workflows/compatibility.yaml [new file with mode: 0644]
completions/gen_docs.sh
completions/zsh/_git-remote-gcrypt

diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml
new file mode 100644 (file)
index 0000000..f0fc56e
--- /dev/null
@@ -0,0 +1,44 @@
+name: Compatibility
+
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron: "0 0 * * 0" # Weekly on Sundays
+
+jobs:
+  # Test across different Ubuntu versions to verify git compatibility
+  git-versions:
+    name: Git Compatibility (${{ matrix.os }})
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest]
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install dependencies
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y git curl python3-docutils
+      - name: Run Tests
+        run: make test
+
+  # Verify generated shell completions are actually valid syntax in their respective shells
+  shell-syntax:
+    name: Shell Completion Syntax
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install Shells
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y zsh fish
+      - name: Generate Completions
+        run: make generate
+      - name: Check Bash Syntax
+        run: bash -n completions/bash/git-remote-gcrypt
+      - name: Check Zsh Syntax
+        run: zsh -n completions/zsh/_git-remote-gcrypt
+      - name: Check Fish Syntax
+        run: fish --no-execute completions/fish/git-remote-gcrypt.fish
index 3d03d4f5ae0555307679c9107adbcdbe69ed634d..a270fbd697b40487ead052c8d7d38d3fb4caa871 100755 (executable)
@@ -63,9 +63,7 @@ CLEAN_FLAGS_ZSH=$(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 (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]'
+       # Build exclusion list (all flags in this group exclude each other self
 
        # Check if we have multiple flags (aliases)
        if echo "$line" | grep -q " "; then
@@ -87,11 +85,11 @@ CLEAN_FLAGS_ZSH=$(echo "$CLEAN_FLAGS_RAW" | while read -r line; do
        # Use printf to avoid newline issues in variable
        # Zsh format: '(-f --force)'{-f,--force}'[Actually delete files]'
        if [ -n "$excl" ]; then
-               printf "'%s'%s'%s'" "$excl" "$fspec" "$desc"
+               printf "'%s'%s'%s'\n" "$excl" "$fspec" "$desc"
        else
-               printf "%s'%s'" "$fspec" "$desc"
+               printf "%s'%s'\n" "$fspec" "$desc"
        fi
-done | tr '\n' ' ')
+done | tr '\n' ' ' | sed 's/ $//')
 
 # For Fish
 # We need to turn "-f --force" into: -s f -l force
index acf8053e9c46140e8d57f094dbec1438053224c4..7de0fd92736a5647659e0611adc86ebc84fd58ac 100644 (file)
@@ -14,7 +14,7 @@ _git_remote_gcrypt() {
 
        case $line[1] in
                clean)
-                       _arguments --force'[Flag]'--init'[Flag]'--hard'[Flag]' \
+                       _arguments --force'[Flag]' --init'[Flag]' --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)