From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 881201F601 for ; Fri, 9 Dec 2022 01:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbiLIBhJ (ORCPT ); Thu, 8 Dec 2022 20:37:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiLIBhH (ORCPT ); Thu, 8 Dec 2022 20:37:07 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0B986F7B for ; Thu, 8 Dec 2022 17:37:06 -0800 (PST) Received: (qmail 30742 invoked by uid 109); 9 Dec 2022 01:37:06 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 09 Dec 2022 01:37:06 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 19208 invoked by uid 111); 9 Dec 2022 01:37:06 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 08 Dec 2022 20:37:06 -0500 Authentication-Results: peff.net; auth=none Date: Thu, 8 Dec 2022 20:37:04 -0500 From: Jeff King To: Michal =?utf-8?B?U3VjaMOhbmVr?= Cc: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , ZheNing Hu , Git List , Junio C Hamano , Christian Couder , johncai86@gmail.com, Taylor Blau Subject: Re: Question: How to execute git-gc correctly on the git server Message-ID: References: <221208.86a63y9309.gmgdl@evledraar.gmail.com> <20221208011631.GH28810@kitsune.suse.cz> <20221209004918.GI28810@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221209004918.GI28810@kitsune.suse.cz> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Dec 09, 2022 at 01:49:18AM +0100, Michal Suchánek wrote: > > In this case it's the mtime on the object file (or the pack containing > > it). But yes, it is far from a complete race-free solution. > > So if you are pushing a branch that happens to reuse commits or other > objects from an earlier branh that might have been collected ín the > meantime you are basically doomed. Basically yes. We do "freshen" the mtimes on object files when we omit an object write (e.g., your index state ends up at the same tree as an old one). But for a push, there is no freshening. We check the graph at the time of the push and decide if we have everything we need (either newly pushed, or from what we already had in the repo). And that is what's racy; somebody might be deleting as that check is happening. > People deleting a branch and then pushing another variant in which many > objects are the same is a risk. > > People exporting files from somewhere and adding them to the repo which > are bit-identical when independently exported by multiple people and > sometimes deleting branches is a risk. Yes, both of those are risky (along with many other variants). -Peff