From: Junio C Hamano Date: Mon, 19 May 2014 23:25:12 GMT Subject: Re: [PATCH 03/31] refs.c: rename the transaction functions Message-ID: In-Reply-To: Ronnie Sahlberg writes: > I am not sure if we need transactions for other types of data, such as > sha1 objects, but if it turns out we do in the future we can rename > these functions again. I was wrong (and I think you read it in the later patch review). If we need transaction for other types of data, and we will eventually need to coordinate the transaction semantics over refs and those other types of data. It would be far cleaner to express that coordination within the same transaction framework. In other words, we do not want to be in a situation like this: other_transaction_begin(); ref_transaction_begin(); ref_transaction_update(); other_transaction_update(); ref_transaction_commit(); if (other_transaction_commit() != SUCCESS) { ... oops it is too late to roll back the ref_transaction ... other_transaction_rollback(); } and force us doing 3-phase commit inside ourselves to work it around.