dolthub / dolthub/dolt

Get the branches each commit is on

Open
#6,384 0 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
customer issue enhancement system tables version control
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

A customer asked for a system table to list the branches each commit is on. You can do this with a recursive common table expression:

```
with recursive branch_commits (branch, commit) as (
select name, hash from dolt_branches
union
select branch, parent_hash
from dolt_commit_ancestors
join branch_commits
on commit = commit_hash
where parent_hash is not NULL
)
select * from branch_commits;
```

We should consider making this it's own system table, something like `dolt_commit_branches`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.