Skip to content

Conversation

@elianddb
Copy link
Contributor

@elianddb elianddb commented Nov 19, 2025

Fixes #1374
Companion dolthub/doltgresql#2039
Dolt now supports separate author and committer information for commits! Committer time is set when the commit is written to storage. dolt_log and dolt_log() now show author-related columns as the last columns in their tables, this includes optional columns in dolt_log().

⚠️ The committer columns now show the real committer data in commit-related system tables. Previous versions of Dolt would display author names, emails and dates within committer related columns. This should not cause any issues, however, to stay backward compatible, when dolt connects to an older sql-server it'll switch back to this methodology to read commit metadata from dolt_log when running commands, i.e. dolt log, dolt show, etc.

Users can set committer name and email using the DOLT_COMMITTER_NAME and DOLT_COMMITTER_EMAIL environment variables. The dolt_log tables' author columns can be controlled with the dolt_log_committer_only system variable for any workflows that may rely on the original view.

export DOLT_COMMITTER_NAME="Committer User"
export DOLT_COMMITTER_EMAIL="committer@example.com"

You can also set a custom committer date using the DOLT_COMMITTER_DATE environment variable, an existing feature:

export DOLT_COMMITTER_DATE="2025-01-01T12:00:00Z"
dolt commit -m "Commit with custom committer date"
dolt sql -q "SELECT commit_hash, committer, email, date, message FROM dolt_log LIMIT 1;"
+----------------------------------+----------------+-----------------------+---------------------+-----------------------------------+
| commit_hash                      | committer      | email                 | date                | message                           |
+----------------------------------+----------------+-----------------------+---------------------+-----------------------------------+
| tdf81ch4ug4c9uc2p78rls1iihj95unn | Committer User | committer@example.com | 2025-01-01 12:00:00 | Commit with custom committer date |
+----------------------------------+----------------+-----------------------+---------------------+-----------------------------------+

When the dolt_log_committer_only system variable is set to true, only committer information is shown in the table, a.k.a. the now legacy view:

SET @@dolt_log_committer_only = true;
+----------------------------------+----------------+-----------------------+---------------------+--------------------------------------+--------------+
| commit_hash                      | committer      | email                 | date                | message                              | commit_order |
+----------------------------------+----------------+-----------------------+---------------------+--------------------------------------+--------------+
| tdf81ch4ug4c9uc2p78rls1iihj95unn | Committer User | committer@example.com | 2025-01-01 12:00:00 | Commit with custom committer date    | 4            |
| 0gonkh11sf1esld53b66jdpbu78sdq6i | Committer User | committer@example.com | 2025-11-19 10:15:43 | Add Charlie with different committer | 3            |
+----------------------------------+----------------+-----------------------+---------------------+--------------------------------------+--------------+

When set to false (default), author columns are included:

+----------------------------------+----------------+-----------------------+---------------------+--------------------------------------+--------------+-----------+------------------+---------------------+
| commit_hash                      | committer      | email                 | date                | message                              | commit_order | author    | author_email     | author_date         |
+----------------------------------+----------------+-----------------------+---------------------+--------------------------------------+--------------+-----------+------------------+---------------------+
| tdf81ch4ug4c9uc2p78rls1iihj95unn | Committer User | committer@example.com | 2025-01-01 12:00:00 | Commit with custom committer date    | 4            | Test User | test@example.com | 2025-11-19 10:15:47 |
| 0gonkh11sf1esld53b66jdpbu78sdq6i | Committer User | committer@example.com | 2025-11-19 10:15:43 | Add Charlie with different committer | 3            | Test User | test@example.com | 2025-11-19 10:15:43 |
+----------------------------------+----------------+-----------------------+---------------------+--------------------------------------+--------------+-----------+------------------+---------------------+

⚠️ On older clients, persisting dolt_log_committer_only will print a warning that it can't be found. dolt_log and dolt_log() can still read the system variable correctly in this sql-server version and will adjust their output to match the above.

  • CommitStagedProps and CommitMeta struct now include CommitterName and CommitterEmail fields that default to author values when not specified.
  • Added CommitterTime() and FormatCommitterTS() methods to CommitMeta for git formatting.
  • CommitMeta.Timestamp changed from uint64 to *uint64 to support deferred initialization at commit write time and force explicit initialization.
  • Added NewCommitMetaWithAuthorCommitter function to create commit metadata with separate author and committer information.
  • Added DOLT_COMMITTER_NAME and DOLT_COMMITTER_EMAIL environment variables.
  • Flatbuffer schema now includes optional committer_name and committer_email fields.
  • Committer-related system tables now display committer information instead of author information in committer columns.
  • dolt_log table and table function includes optional author columns controlled by dolt_log_committer_only system variable. These are appended at the end, after any optional columns in dolt_log()'s case, to stay forward compatible with fixed indices of previous dolt clients.
  • Commit readers read committer fields or normalize on author information when missing said fields for both flatbuffer and Noms formats.
  • Cherry-pick and merge operations preserve committer information from source commits.
  • Added sql-server.bats integration test in compatibility directory to make sure commit-related commands remain forward and backward compatible for specified versions in .txt files.

@elianddb elianddb force-pushed the elian/1374 branch 2 times, most recently from 74ffc16 to 9308b60 Compare November 19, 2025 11:17
@dolthub dolthub deleted a comment from coffeegoddd Nov 19, 2025
@dolthub dolthub deleted a comment from coffeegoddd Nov 19, 2025
@coffeegoddd
Copy link
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
a7811ea ok 5937471
version total_tests
a7811ea 5937471
correctness_percentage
100.0

@dolthub dolthub deleted a comment from coffeegoddd Nov 19, 2025
@macneale4 macneale4 marked this pull request as ready for review November 19, 2025 21:45
@macneale4 macneale4 self-requested a review November 19, 2025 21:45
@coffeegoddd
Copy link
Contributor

@elianddb DOLT

comparing_percentages
100.000000 to 100.000000
version result total
88f5a76 ok 5937471
version total_tests
88f5a76 5937471
correctness_percentage
100.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Commiter" and "Commit Date" to Commit Meta

3 participants