Skip to content

Add git_tags built-in function#3523

Merged
chrisnovakovic merged 2 commits intothought-machine:masterfrom
chrisnovakovic:git_tags
Apr 15, 2026
Merged

Add git_tags built-in function#3523
chrisnovakovic merged 2 commits intothought-machine:masterfrom
chrisnovakovic:git_tags

Conversation

@chrisnovakovic
Copy link
Copy Markdown
Contributor

git_tags() returns a list consisting of the tags that point at the repo's current commit.

`git_tags()` returns a list consisting of the tags that point at the
repo's current commit.
Comment thread rules/builtins.build_defs
def git_state(clean_label:str="clean", dirty_label:str="dirty") -> str:
fail('Disabled in config')
def git_tags() -> list:
fail("Disabled in config")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes - I'll do that for all of them in a follow-up PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread src/parse/asp/exec.go
// 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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread src/parse/asp/exec.go Outdated
Comment thread src/parse/asp/exec.go
Comment thread src/parse/asp/exec.go Outdated
Comment thread src/parse/asp/exec.go Outdated
@chrisnovakovic chrisnovakovic merged commit 859b4c5 into thought-machine:master Apr 15, 2026
13 checks passed
@chrisnovakovic chrisnovakovic deleted the git_tags branch April 15, 2026 16:16
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.

2 participants