Skip to content

feat: support SHA refs for plugin specs#19

Merged
AntoineGS merged 3 commits into
tmuxpack:mainfrom
theZMC:support-sha-refs
Jun 9, 2026
Merged

feat: support SHA refs for plugin specs#19
AntoineGS merged 3 commits into
tmuxpack:mainfrom
theZMC:support-sha-refs

Conversation

@theZMC

@theZMC theZMC commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Closes #18

This PR adds a feature to tpack allowing it to support git commit SHAs.

@theZMC theZMC force-pushed the support-sha-refs branch from 11362e3 to 87d2158 Compare June 4, 2026 01:47
@theZMC theZMC force-pushed the support-sha-refs branch from 87d2158 to ba9bc36 Compare June 4, 2026 01:49
@AntoineGS

AntoineGS commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Yeah that's better than doing branches only!
I will review it over the next few days and merge it, thank you.

Update: Don't worry about the goreleaser failure, I'll look into it.

AntoineGS added 2 commits June 9, 2026 09:49
Pass --end-of-options before the checkout to prevent.
Prevent classifying a branch/tag as a commit/SHA by always trying to
resolve it as a branch/tag first. Slower but more accurate.
A symbolic-ref exit code other than 1 (e.g. not a git repo, git missing)
was silently swallowed, falling through to git fetch. Return the error
directly so genuine failures are reported at their source.
@AntoineGS

Copy link
Copy Markdown
Collaborator

I pushed some changes if you would like to take a look before I merge this, nothing major just some additional safety/error handling.
It will always try the SHA as a branch/tag first in case it looks like a SHA but isn't, it is slower but will be 100% accurate.
I also ensured non 1 returns are handled in IsOutdated and resurfaced to the user.

@theZMC

theZMC commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Yep, looks good! I was also wondering if there was a better way of identifying SHAs than just a regex which could match on weird branch or tag names and I think your solution is cleaner, so LGTM.

@AntoineGS AntoineGS merged commit dbbcf88 into tmuxpack:main Jun 9, 2026
4 of 5 checks passed
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.

Tpack should support SHA pins for plugins

2 participants