Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 11 Sep 09:38
· 7 commits to main since this release
v0.2.0
ca97026

Changed

  • git::is_dirty answers with its exit status instead of printing a string. It exits 0
    when the working tree has uncommitted changes, 1 when it is clean, and prints nothing.

    This breaks any caller that read the printed suffix. Build it from the answer:

    if rt git::is_dirty; then sha="$sha-dirty"; fi

    It used to print -dirty or an empty line and exit 0 either way, so the call its name
    invites ran its body whatever the tree looked like:

    $ rt git::is_dirty && echo "DIRTY" || echo "clean"
    DIRTY          # on a clean tree

    A working tree that cannot be read is now reported as dirty, with the reason on stderr.
    git::head_sha is unaffected and still prints 8a7a7b6-dirty.

Choices

Renaming it to say what it returned, git::dirty_suffix, would have kept every caller
working. The predicate won because both callers here wanted a yes or no rather than the
string, and a code search across every org and then globally found none outside this
repository. The rename would have left a command that reads as a question and cannot be
used as one, under a longer name.