Skip to content

Experimental: repository transactions

John Cai requested to merge jc-repo-tx into master

This experiment tries to use a ref to "lock" the repository for a transaction in the following way:

  1. start transaction - git update-ref refs/tx/transaction <blob_id> 0000000000000000000000000000000000000000 When something wants to mutate a repository, it first has to be able to write a new ref at 'refs/tx/transaction'. Since update-ref is atomic, only one process will be able to do this. The rev can be of an id of a blob that we write that contains some metadata about the transaction. (currently only including the actual command that is to be run)

  2. commit transaction - git update-ref -d refs/tx/transaction When we want to commit a transaction, we simply delete the refs/tx/transaction ref after whatever mutation we want to do to the repository.

Edited by John Cai

Merge request reports