Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotated tag support #109

Merged
merged 6 commits into from
Sep 19, 2023
Merged

Add annotated tag support #109

merged 6 commits into from
Sep 19, 2023

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Sep 18, 2023

Adds support for using annotated tags (e.g. git tag -a ...). This means that timestamps used as the "end" of the scope of changes will use the time which the tag action was performed, not the timestamp of the underlying commit (code change). This is useful given the issues described in #96 (comment) .

While making this change I tried to make apparent in the logging what values were being used for what operations since there were additional input parameters that could be used (e.g. timestamp from an annotated tag vs underlying commit). Surrounding logging changes were done to keep the output consistent and useful.

Closes #35
Fixes #96

@wagoodman wagoodman requested a review from a team September 18, 2023 22:08
@wagoodman wagoodman self-assigned this Sep 18, 2023
internal/git/head.go Outdated Show resolved Hide resolved
internal/git/tag.go Outdated Show resolved Hide resolved
internal/git/tag.go Outdated Show resolved Hide resolved
// the plumbing reference is to the tag. For a lightweight tag, the tag object points directly to the commit
// with the code blob. For an annotated tag, the tag object has a commit for the tag itself, but resolves to
// the commit with the code blob. It's important to use the timestamp from the tag object when available
// for annotated tags and to use the commit timestamp for lightweight tags.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this comment! It's really helpful.

internal/git/tag.go Show resolved Hide resolved
internal/git/tag_test.go Outdated Show resolved Hide resolved

repos/remote-repo:
repos/remote-repo: create-remote-repo.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makefile question: What's the point of depending on the file create-remote-repo.sh if nothing is going to create it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case create-remote-repo.sh content changes, then the target will be run again (it's based on a mod timestamp comparison)

Copy link
Contributor Author

@wagoodman wagoodman Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh fun! I won't do this though, seems to cause issues in CI where a cache is restored (thus the timestamps could be off)... there is a failure in CI showing this. I'll delete the cache and remove the dependency here.

The other oversight I had: the fixture scripts wont delete existing fixtures. I could update them to do this, but for the meantime I'll just remove the source dependency.

@wagoodman wagoodman merged commit 69a0928 into main Sep 19, 2023
6 checks passed
@wagoodman wagoodman deleted the add-annotated-tag-support branch September 19, 2023 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected results from several recent releases Support annotated tags
2 participants