Skip to content

Allow passing --date to DOLT_MERGE (as is the case for DOLT_COMMIT) #11037

@NoTuxNoBux

Description

@NoTuxNoBux

DOLT_COMMIT allows setting a custom date and time using --date. However, the same is not possible for the merge commit that DOLT_MERGE generates, for example with --no-ff active.

The use case we have is that we would like to generate some 'fixtures' or fake commits with older timestamps to generate a semi-realistic commit log for testing purposes. This works well enough with dolt sql and the --date flag for commits, but seems to be impossible for merge commits, specifically.

So far I've found no good way to fake the time for these commits in Dolt:

  • libfaketime and LD_PRELOADing the library into the Dolt SQL server doesn't appear to work, nor does it work for the dolt sql command - the README of the library mentions golang applications being possibly problematic, though.
  • Setting MySQL's TIMESTAMP using SET TIMESTAMP = UNIX_TIMESTAMP('1980-01-01T12:34:56'); before doing a commit, but whilst Dolt SQL accepts the sets, subsequent calls to NOW() or doing commits still use the system time.

My last resort is a full-blown VM where I have control over the time or setting system time globally outside the container (it is blocked by default and requires elevated privileges), but since it is tied to the host time, doing so is not great because it's not particularly cross-platform and breaks outside of the containers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions