girt 0.2.0

An incremental, idiomatic Rust implementation of Git
Documentation
name: Platform validation

on:
  push:
  pull_request:
  workflow_dispatch:
    inputs:
      ignore_windows_only:
        description: Restrict focused ignore checks to Windows
        type: boolean
        default: false
      ignore_only:
        description: Run focused ignore compatibility and performance checks
        type: boolean
        default: false
      storage_only:
        description: Run only focused file-backed storage checks
        type: boolean
        default: false
      alternates_only:
        description: Run only focused native alternate storage checks
        type: boolean
        default: false
      http_only:
        description: Run only focused Windows HTTP regression checks
        type: boolean
        default: false
      retention_only:
        description: Run focused retention and repack checks
        type: boolean
        default: false

permissions:
  contents: read

jobs:
  msrv:
    runs-on: ubuntu-26.04
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - run: rustup toolchain install 1.97.1 --profile minimal
      - run: cargo +1.97.1 check --locked --all-targets --all-features
      - run: cargo +1.97.1 test --locked --no-default-features --lib

  unix:
    if: ${{ !inputs.ignore_only && !inputs.http_only && !inputs.alternates_only && !inputs.storage_only && !inputs.retention_only }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, macos-14]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Toolchain and environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          uname -a
          if [ "$RUNNER_OS" = Linux ]; then
            cat /etc/os-release
            df -T . "$(python3 -c 'import tempfile; print(tempfile.gettempdir())')"
          else
            sw_vers
            diskutil info "$(df . | tail -1 | awk '{print $1}')"
            diskutil info "$(df "$(python3 -c 'import tempfile; print(tempfile.gettempdir())')" | tail -1 | awk '{print $1}')"
          fi
      # Tracing fixture dispatchers share tracing-core's global callsite cache.
      - run: cargo +stable test --locked --all-features -- --test-threads=1
      - name: Core-only runtime without tracing
        run: >-
          cargo +stable test --locked --no-default-features --no-fail-fast
          --lib --test layout_shallow --test worktree_create --test worktree_admin --test object_ids --test sha256 --test commits --test decoding --test packs --test index --test colocation --test references --test references_portable --test retention
      - name: Core-only library
        run: cargo +stable check --locked --lib --no-default-features
      - name: HTTP-only library
        run: cargo +stable check --locked --lib --no-default-features --features http
      - name: Tracing without network dependencies
        run: cargo +stable test --locked --no-default-features --features tracing --test tracing
      - name: Tracing HTTP lifecycle
        run: cargo +stable test --locked --no-default-features --features tracing,http --test tracing
      - name: Tracing SSH-only library
        run: cargo +stable check --locked --lib --no-default-features --features tracing,ssh
      - name: SSH-only library
        run: cargo +stable check --locked --lib --no-default-features --features ssh
      - name: HTTP-only runtime without tracing
        run: cargo +stable test --locked --no-default-features --features http --no-fail-fast --test http --test http_portable
      - name: SSH-only runtime without tracing
        run: cargo +stable test --locked --no-default-features --features ssh --test ssh
      - run: cargo +stable clippy --locked --all-features --all-targets -- -D warnings
      - run: cargo +stable run --locked --example fetch_local
      - run: cargo +stable run --locked --example push_local
      - run: cargo +stable run --locked --features http --example http_local
      - run: cargo +stable run --locked --features ssh --example ssh_local
      - run: cargo +stable run --locked --example content_diff
      - run: cargo +stable run --locked --example index
      - run: cargo +stable run --locked --example write_pack
      - run: cargo +stable run --locked --example init_repository
      - run: cargo +stable run --locked --features tracing --example tracing
      - run: cargo +stable run --locked --example reference_transaction
      - run: cargo +stable run --locked --example status
      - run: cargo +stable run --locked --example checkout
      - name: Rustdoc
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo +stable doc --locked --all-features --no-deps --document-private-items

  windows:
    if: ${{ !inputs.ignore_only && !inputs.http_only && !inputs.alternates_only && !inputs.storage_only && !inputs.retention_only }}
    # Portable integrations are explicit; native local transfer runs on Windows.
    runs-on: windows-2022
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Toolchain and environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber | ConvertTo-Json -Compress
          Get-Volume | Where-Object DriveLetter | Select-Object DriveLetter, FileSystem, FileSystemLabel | ConvertTo-Json -Compress
          Write-Output "Temporary directory: $env:TEMP"
      - name: Native local transfer
        run: cargo +stable test --locked --no-default-features --test local_native
      - name: Core-only library
        run: cargo +stable check --locked --lib --no-default-features
      - name: HTTP-only library
        run: cargo +stable check --locked --lib --no-default-features --features http
      - name: Tracing without network dependencies
        run: cargo +stable test --locked --no-default-features --features tracing --test tracing
      - name: Tracing HTTP lifecycle
        run: cargo +stable test --locked --no-default-features --features tracing,http --test tracing
      - name: Tracing SSH-only library
        run: cargo +stable check --locked --lib --no-default-features --features tracing,ssh
      - name: SSH-only library
        run: cargo +stable check --locked --lib --no-default-features --features ssh
      - run: cargo +stable clippy --locked --all-features --all-targets -- -D warnings
      - run: cargo +stable test --locked --all-features --lib
      - name: Core-only units without tracing
        run: cargo +stable test --locked --no-default-features --lib
      - run: cargo +stable test --locked --all-features --doc
      - name: Portable Git interoperability in both object formats
        run: >-
          cargo +stable test --locked --no-default-features --no-fail-fast
          --test object_ids --test sha256 --test blobs --test trees --test commits --test decoding --test discovery --test tags --test packs
          --test history --test repositories --test layout_shallow --test worktree_create --test worktree_admin --test config_resolution --test config_edit --test remotes --test tree_compare --test content_diff --test index --test colocation --test status_portable --test checkout_portable --test references --test references_portable --test retention
      - name: Portable HTTP runtime
        if: ${{ !cancelled() }}
        run: cargo +stable test --locked --no-default-features --features http --no-fail-fast --test http --test http_portable
      - run: cargo +stable run --locked --example content_diff
      - run: cargo +stable run --locked --example index
      - run: cargo +stable run --locked --example write_pack
      - run: cargo +stable run --locked --example init_repository
      - run: cargo +stable run --locked --features tracing --example tracing
      - name: Public Rustdoc
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo +stable doc --locked --all-features --no-deps

  windows-http:
    if: ${{ inputs.http_only }}
    runs-on: windows-2022
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Toolchain and environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber | ConvertTo-Json -Compress
          Get-Volume | Where-Object DriveLetter | Select-Object DriveLetter, FileSystem, FileSystemLabel | ConvertTo-Json -Compress
          Write-Output "Temporary directory: $env:TEMP"
      - name: HTTP runtime regression
        run: cargo +stable test --locked --no-default-features --features http --no-fail-fast --test http --test http_portable -- --show-output
      - name: HTTP test Clippy
        run: cargo +stable clippy --locked --no-default-features --features http --test http --test http_portable -- -D warnings

  alternates:
    if: ${{ inputs.alternates_only }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, macos-14, windows-2022]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Toolchain and environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          python -c "import platform,tempfile; print(platform.platform()); print(tempfile.gettempdir())"
      - name: Both-format alternate and repository contracts
        run: cargo +stable test --locked --no-default-features --test alternates --test repositories --test packs
      - name: Parser units and tracing build
        run: cargo +stable test --locked --all-features --lib objects::alternates
      - name: Scoped Clippy
        run: cargo +stable clippy --locked --all-features --lib --test alternates --test repositories --test packs -- -D warnings
      - name: Original Git observations
        run: python tests/fixtures/alternates/observe.py

  storage:
    if: ${{ inputs.storage_only }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, macos-14, windows-2022]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 25
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          python -c "import platform,tempfile; print(platform.platform()); print(tempfile.gettempdir())"
      - name: Storage behavior and original decoder corpus
        run: cargo +stable test --locked --all-features --lib --test packs --test alternates --test repositories --test refresh
      - name: Scoped Clippy
        run: cargo +stable clippy --locked --all-features --lib --test packs --test alternates --test repositories --test refresh --example storage_resources --bench packs -- -D warnings
      - name: Refresh after received-pack installation
        if: runner.os != 'Windows'
        run: cargo +stable test --locked --all-features --test fetch imports_server_deltas_and_all_object_kinds
      - name: Large original Git fixture
        run: python tests/fixtures/file-storage/generate.py large-store sha1
      - name: Build isolated resource probe
        run: cargo +stable build --locked --release --example storage_resources
      - name: Measure reader resources and cancellation
        run: python tests/fixtures/file-storage/measure.py large-store
      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        if: always()
        with:
          name: storage-${{ matrix.os }}
          path: |
            large-store/workload.json
            storage-measurements.json

  ignore:
    if: ${{ inputs.ignore_only }}
    strategy:
      fail-fast: false
      matrix:
        os: ${{ inputs.ignore_windows_only && fromJSON('["windows-2022"]') || fromJSON('["ubuntu-26.04", "macos-14", "windows-2022"]') }}
    runs-on: ${{ matrix.os }}
    timeout-minutes: 25
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Environment
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          python -c "import platform,tempfile; print(platform.platform()); print(tempfile.gettempdir())"
      - name: Unit and public compatibility cases
        run: "cargo +stable test --locked --no-default-features --lib --test ignore ignore::"
      - name: Both-format Git comparisons
        run: cargo +stable test --locked --no-default-features --test ignore
      - name: Tracing feature composition
        run: "cargo +stable test --locked --no-default-features --features tracing --lib --test ignore ignore::"
      - name: Clippy
        run: cargo +stable clippy --locked --no-default-features --lib --test ignore --bench ignore --example ignore_batch -- -D warnings
      - name: Build batch adapter
        run: cargo +stable build --locked --release --example ignore_batch
      - name: Independent adversarial observations
        run: python tests/fixtures/ignore/observe.py > ignore-observations.json
      - name: Large source resources
        run: python tests/fixtures/ignore/resources.py > ignore-resources.json
      - name: Representative matched batches
        run: cargo +stable bench --locked --bench ignore -- --noplot
      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        if: always()
        with:
          name: ignore-${{ matrix.os }}
          path: |
            ignore-observations.json
            ignore-resources.json
            target/criterion

  retention:
    if: ${{ inputs.retention_only }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, macos-14, windows-2022]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Toolchain and Git
        run: |
          rustup toolchain install stable --profile minimal --component clippy
          rustc +stable -Vv
          git --version
          python -c "import platform,tempfile; print(platform.platform()); print(tempfile.gettempdir())"
      - name: Retention and repack cases
        run: cargo +stable test --locked --no-default-features --test retention
      - name: Maintenance fault and race cases
        run: |
          cargo +stable test --locked --no-default-features --lib 'retention::'
          cargo +stable test --locked --no-default-features --lib 'refs::reftable::stack_tests::expiry_'
      - name: Retention API and benchmark lint
        run: cargo +stable clippy --locked --no-default-features --lib --test retention --bench retention -- -D warnings