From: Shane Jaroch Date: Sat, 17 Jan 2026 08:04:59 +0000 (-0500) Subject: add compatibility workflow; fix format X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=93ea3859400cf1285e09c4b105697321ff6f6447;p=gamesguru%2Fgit-remote-gcrypt.git add compatibility workflow; fix format --- diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml new file mode 100644 index 0000000..f0fc56e --- /dev/null +++ b/.github/workflows/compatibility.yaml @@ -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 diff --git a/completions/gen_docs.sh b/completions/gen_docs.sh index 3d03d4f..a270fbd 100755 --- a/completions/gen_docs.sh +++ b/completions/gen_docs.sh @@ -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 diff --git a/completions/zsh/_git-remote-gcrypt b/completions/zsh/_git-remote-gcrypt index acf8053..7de0fd9 100644 --- a/completions/zsh/_git-remote-gcrypt +++ b/completions/zsh/_git-remote-gcrypt @@ -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)