Skip to content

EARTHBUILD_GIT_CONTENT_HASH #339

@gilescope

Description

@gilescope

What existing functionality needs improvement?

We have EARTHLY_GIT_SHORT_HASH, and EARTHLY_GIT_HASH but git has a content addressable tree in it.

Ideally images could be tagged with EARTHBUILD_GIT_CONTENT_HASH=$(git rev-parse $EARTHLY_GIT_HASH^{tree}).

We should popularise that content addressability can exist from git repos and that if you tag with it, you'll get some nice cache hits on images already existing in repos.

Is there a reason not to promote people creating images and tagging them with the git tree hash? It seems stable against squashes and rebases - it only cares about the contents that's checked out it seems. Am I missing something or is this awesome?

Prior art: https://dev.to/taskworld/save-the-precious-build-minutes-reusing-build-outputs-with-git-tree-hash-k61

Expected Behavior

implemented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions