Add git_tags built-in function#3523
Merged
chrisnovakovic merged 2 commits intothought-machine:masterfrom Apr 15, 2026
Merged
Conversation
`git_tags()` returns a list consisting of the tags that point at the repo's current commit.
toastwaffle
approved these changes
Apr 15, 2026
| def git_state(clean_label:str="clean", dirty_label:str="dirty") -> str: | ||
| fail('Disabled in config') | ||
| def git_tags() -> list: | ||
| fail("Disabled in config") |
Contributor
There was a problem hiding this comment.
I appreciate you're following the existing pattern, but do you think we should be explicit here about it being parse.GitFunctions in the config?
Contributor
Author
There was a problem hiding this comment.
Yes - I'll do that for all of them in a follow-up PR.
| // NOTE: Commands that rely on the current working directory must not be cached. | ||
| func doExec(s *scope, cmdIn pyObject, cacheOutput bool, storeNegative bool) (pyObj pyObject, success bool, err error) { | ||
| // NOTE: Commands that rely on the current working directory must not have their output cached. | ||
| func doExec(s *scope, cmdIn pyObject, cacheOutput, storeNegative, outputAsList bool) (pyObj pyObject, success bool, err error) { |
Contributor
There was a problem hiding this comment.
I'm not suggesting you fix this now, but why on earth does this take a pyObject? As far as I can tell, it is only used with hard-coded lists of commands...
Contributor
Author
There was a problem hiding this comment.
My guess is that this function was originally written with the intention of it being exposed directly to ASP in future, but that (thankfully) never happened.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git_tags()returns a list consisting of the tags that point at the repo's current commit.