Skip to content

Conversation

@tonistiigi
Copy link
Member

based on #6244

git: fix annotated tag pinning and cache keys

Pin of annotated tag should be tha SHA of tag, not
the commit it is pointing to.

Cache key of annotated tag should be SHA of the tag
if keep-git-dir is enabled and SHA of underlying
commit otherwise.

git: allow checksum of annotated tag ref match either tag or commit sha

This is more flexible as from the user standpoint it might not
be easy to know if a version tag is annotated or not.

Downside of this change is that we can't create a cache key
automatically when checksum was set and no keep-git-dir as we
don't know which checksum is being used.

Signed-off-by: Tonis Tiigi tonistiigi@gmail.com

Pin of annotated tag should be tha SHA of tag, not
the commit it is pointing to.

Cache key of annotated tag should be SHA of the tag
if keep-git-dir is enabled and SHA of underlying
commit otherwise.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This is more flexible as from the user standpoint it might not
be easy to know if a version tag is annotated or not.

Downside of this change is that we can't create a cache key
automatically when checksum was set and no keep-git-dir as we
don't know which checksum is being used.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

Needed to change some expected values in dockerfile test. These were related to how the previous implementation matched the cache based on the checksum. Afaics, it is more correct now, but a bit slower in some cases.

@AkihiroSuda AkihiroSuda merged commit 0d9a1e1 into moby:master Oct 1, 2025
139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants