Re: [PATCH] rollback index if git-commit is interrupted by a signal
- From
Paolo Bonzini <bonzini@gnu.org>
- Date
- May 29, 2008, 14:35 UTC
- Message-ID
- <483EBF1F.9000809@gnu.org>
- In-Reply-To
- <alpine.DEB.1.00.0805291456030.13507@racer.site.net>
Show 7 quoted lines
>> Without this change, there could be races between the time the lock file >> is created and the time the commit_style variable is set, leading to the >> rollback not being performed. > > IMO it would make much more sense to _guarantee_ that the commity_style > variable is set before the index is locked. It is feasible, and there is > no good reason not to do that.
No, it's not possible because the COMMIT_PARTIAL case first creates the index_lock and then the false_lock. It would be curious at least to set the commit_style to COMMIT_NORMAL after creating the index_lock, and upgrade it to COMMIT_PARTIAL later on. I contemplated that, and my patch is the simplest code that's needed and works.
Paolo