--- /dev/null
+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
# 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
# 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
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)