From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f51.google.com ([209.85.214.51]:46350 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753833AbeAQWZn (ORCPT ); Wed, 17 Jan 2018 17:25:43 -0500 MIME-Version: 1.0 In-Reply-To: References: <20180117184828.31816-1-hch@lst.de> <87h8rki2iu.fsf@evledraar.gmail.com> From: Linus Torvalds Date: Wed, 17 Jan 2018 14:25:41 -0800 Message-ID: Subject: Re: [PATCH] enable core.fsyncObjectFiles by default To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: Junio C Hamano , Christoph Hellwig , Git Mailing List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jan 17, 2018 at 2:07 PM, Linus Torvalds wrote: > > The original git design was very much to write each object file > without any syncing, because they don't matter since a new object file > - by definition - isn't really reachable. Then sync before writing the > index file or a new ref. .. actually, I think it originally sync'ed only before starting to actually remove objects due to repacking. The theory was that you can lose the last commit series or whatever, and have to git-fsck, and have to re-do it, but you could never lose long-term work. If your machine crashes, you still remember what you did just before the crash. That theory may have been more correct back in the days than it is now. People who use git might be less willing to treat it like a filesystem that you can fsck than I was back 10+ ago. It's worth noting that the commit that Junio pointed to (from 2008) didn't actually change any behavior. It just allowed people who cared to change behavior. The original "let's not waste time on fsync every object write, because we can just re-create the state anyway" behavior goes back to 2005. Linus