datakit icon indicating copy to clipboard operation
datakit copied to clipboard

Finer control over commit behaviour

Open talex5 opened this issue 7 years ago • 1 comments

Some possible improvements to the client API (for discussion):

  • Add 'fast-forward-only' commit mode, that fails if there have been any changes on the branch since the transaction started. The client can then merge the new head manually or abort the transaction. This is useful if you need to avoid the default merge behaviour.
  • Add skip-if-empty commit mode that checks whether the new tree is equal to the existing one and succeeds without making a commit if so.
  • Allow creating a transaction from any starting commit, not just the current head. This is useful if you want to make a commit in response to a watch event.
  • Report the generated commit ID as the result of committing. Not sure about this one, as you'd normally want to ignore this.

talex5 avatar Jul 20 '16 10:07 talex5

It would also be useful to know if a current transaction is dirty or not (maybe have a dirty file at the root of the transaction, which, if it exists, lists the changed files?)

samoht avatar Jul 20 '16 13:07 samoht