Implement commit_order in dolt_log system table and table function#9250
Merged
Implement commit_order in dolt_log system table and table function#9250
Conversation
Contributor
|
@coffeegoddd DOLT
|
Contributor
|
@coffeegoddd DOLT
|
Contributor
Contributor
Author
|
I manually tested this and it seems to work: $ dolt init --fun
Successfully initialized dolt data repository.
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| commit_hash | committer | email | date | message | commit_order |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| d0lt4bas03smpcqv3nhig1aa7monspp8 | timsehn | tim@dolthub.com | 2025-05-27 22:53:08 | Іnіtіalіzе datа repositоry | 1 |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
$ dolt commit --allow-empty -m "Another"
commit 50ipro4d1hd1kcnbgbf95n7oi305laql (HEAD -> main)
Author: timsehn <tim@dolthub.com>
Date: Tue May 27 15:53:41 -0700 2025
Another
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| commit_hash | committer | email | date | message | commit_order |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| 50ipro4d1hd1kcnbgbf95n7oi305laql | timsehn | tim@dolthub.com | 2025-05-27 22:53:41 | Another | 2 |
| d0lt4bas03smpcqv3nhig1aa7monspp8 | timsehn | tim@dolthub.com | 2025-05-27 22:53:08 | Іnіtіalіzе datа repositоry | 1 |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
$ dolt branch b1
$ dolt commit --allow-empty -m "Another main"
commit 8n4gk4eoil6le7nvhgno1tk0kqiosurn (HEAD -> main)
Author: timsehn <tim@dolthub.com>
Date: Tue May 27 15:54:02 -0700 2025
Another main
$ dolt checkout b1
Switched to branch 'b1'
$ dolt commit --allow-empty -m "Another b1"
commit 247541rgkebo3bpbnvfd81ql6hfe40np (HEAD -> b1)
Author: timsehn <tim@dolthub.com>
Date: Tue May 27 15:54:15 -0700 2025
Another b1
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| commit_hash | committer | email | date | message | commit_order |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| 247541rgkebo3bpbnvfd81ql6hfe40np | timsehn | tim@dolthub.com | 2025-05-27 22:54:15 | Another b1 | 3 |
| 50ipro4d1hd1kcnbgbf95n7oi305laql | timsehn | tim@dolthub.com | 2025-05-27 22:53:41 | Another | 2 |
| d0lt4bas03smpcqv3nhig1aa7monspp8 | timsehn | tim@dolthub.com | 2025-05-27 22:53:08 | Іnіtіalіzе datа repositоry | 1 |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
$ dolt checkout main
Switched to branch 'main'
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| commit_hash | committer | email | date | message | commit_order |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
| 8n4gk4eoil6le7nvhgno1tk0kqiosurn | timsehn | tim@dolthub.com | 2025-05-27 22:54:02 | Another main | 3 |
| 50ipro4d1hd1kcnbgbf95n7oi305laql | timsehn | tim@dolthub.com | 2025-05-27 22:53:41 | Another | 2 |
| d0lt4bas03smpcqv3nhig1aa7monspp8 | timsehn | tim@dolthub.com | 2025-05-27 22:53:08 | Іnіtіalіzе datа repositоry | 1 |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+--------------+
$ dolt merge --no-ff b1
Updating kf9jk3glcs8levjbdtufie1uvfpbvbgg..247541rgkebo3bpbnvfd81ql6hfe40np
Everything up-to-date
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+-----------------------------+--------------+
| commit_hash | committer | email | date | message | commit_order |
+----------------------------------+-----------+-----------------+---------------------+-----------------------------+--------------+
| kf9jk3glcs8levjbdtufie1uvfpbvbgg | timsehn | tim@dolthub.com | 2025-05-27 22:54:47 | Merge branch 'b1' into main | 4 |
| 247541rgkebo3bpbnvfd81ql6hfe40np | timsehn | tim@dolthub.com | 2025-05-27 22:54:15 | Another b1 | 3 |
| 8n4gk4eoil6le7nvhgno1tk0kqiosurn | timsehn | tim@dolthub.com | 2025-05-27 22:54:02 | Another main | 3 |
| 50ipro4d1hd1kcnbgbf95n7oi305laql | timsehn | tim@dolthub.com | 2025-05-27 22:53:41 | Another | 2 |
| d0lt4bas03smpcqv3nhig1aa7monspp8 | timsehn | tim@dolthub.com | 2025-05-27 22:53:08 | Іnіtіalіzе datа repositоry | 1 |
+----------------------------------+-----------+-----------------+---------------------+-----------------------------+--------------+
$ dolt commit --allow-empty -m "Another main"
commit mofkhajnmboief6p6dgip4lhshptj1k5 (HEAD -> main)
Author: timsehn <tim@dolthub.com>
Date: Tue May 27 15:55:12 -0700 2025
Another main
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+-----------------------------+--------------+
| commit_hash | committer | email | date | message | commit_order |
+----------------------------------+-----------+-----------------+---------------------+-----------------------------+--------------+
| mofkhajnmboief6p6dgip4lhshptj1k5 | timsehn | tim@dolthub.com | 2025-05-27 22:55:12 | Another main | 5 |
| kf9jk3glcs8levjbdtufie1uvfpbvbgg | timsehn | tim@dolthub.com | 2025-05-27 22:54:47 | Merge branch 'b1' into main | 4 |
| 247541rgkebo3bpbnvfd81ql6hfe40np | timsehn | tim@dolthub.com | 2025-05-27 22:54:15 | Another b1 | 3 |
| 8n4gk4eoil6le7nvhgno1tk0kqiosurn | timsehn | tim@dolthub.com | 2025-05-27 22:54:02 | Another main | 3 |
| 50ipro4d1hd1kcnbgbf95n7oi305laql | timsehn | tim@dolthub.com | 2025-05-27 22:53:41 | Another | 2 |
| d0lt4bas03smpcqv3nhig1aa7monspp8 | timsehn | tim@dolthub.com | 2025-05-27 22:53:08 | Іnіtіalіzе datа repositоry | 1 |
+----------------------------------+-----------+-----------------+---------------------+-----------------------------+--------------+ |
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.
This PR implements: #9145. This is implemented using Claude Code.
A customer asked for the commit order in the
dolt_logsystem table. We have that information as we generate the commit log in the height variable. This exposes that variable as a column populated for each commit.