Skip to content

Reorganize refs optimization tests to properly handle backend-specific vs backend-agnostic tests

Context

Currently, t/t1463-refs-optimize.sh enforces the files ref format for all tests using:

GIT_TEST_DEFAULT_REF_FORMAT=files
export GIT_TEST_DEFAULT_REF_FORMAT

This test file sources pack-refs-tests.sh, which is also used by t/t0601-reffiles-pack-refs.sh.

Problem

  1. The refs optimize command isn't backend-specific, but t1463 currently enforces the files format
  2. The naming doesn't reflect that the test is backend-specific
  3. Adding reftable-specific tests to the current structure is awkward
  4. The shared test file pack-refs-tests.sh has confusing naming given its usage

Proposed Solution

Two potential approaches discussed:

Option 1: Keep t1463 backend-agnostic

  • Remove GIT_TEST_DEFAULT_REF_FORMAT=files from t1463
  • Add REFFILES prerequisite to existing tests in pack-refs-tests.sh
  • Add reftable-specific tests using git init --ref-format=reftable

Option 2: Move to t06* range and create separate test files

  • Move t1463 to the t06* range (backend-specific tests)
  • Introduce a separate reftable-specific test file for refs optimization
  • Create a new backend-generic test suite if needed

Recommendation

Option 2 is preferred as it:

  • Properly reflects that current tests are backend-specific through naming/location
  • Keeps backend-specific tests in the t06* range where they belong
  • Allows for cleaner separation between reffiles and reftable tests

Related Files

  • t/t1463-refs-optimize.sh
  • t/t0601-reffiles-pack-refs.sh
  • t/pack-refs-tests.sh

Discussion from Slack thread

Edited by Karthik Nayak