Skip to content

Clarify freshness semantics for check_script_up_to_date #13

Description

@codeforester

Context

check_script_up_to_date compares local HEAD with the configured upstream ref, but it does not fetch first. If remote-tracking refs are stale, the function can report up to date when the remote has moved.

Fetching unconditionally may be undesirable in offline or latency-sensitive scripts, so this needs an explicit API/product decision.

Scope

  • Decide whether check_script_up_to_date should fetch by default, fetch behind an option/env var, or explicitly remain a local-ref-only check.
  • Implement the chosen behavior in lib/bash/git/lib_git.sh.
  • Update lib/bash/git/README.md to describe the freshness contract.
  • Add BATS coverage for the selected behavior.

Acceptance Criteria

  • Callers can tell whether the check reflects live remote state or only local remote-tracking refs.
  • Stale-ref behavior is tested or documented as intentional.
  • Existing skip conditions for no git, no upstream, untracked scripts, and non-repo paths remain predictable.

Validation

  • ./tests/validate.sh

Suggested Branch

enhancement/<issue>-20260618-script-freshness-contract

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions