From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id A7E9E1F453 for ; Wed, 24 Oct 2018 08:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727600AbeJXQjQ (ORCPT ); Wed, 24 Oct 2018 12:39:16 -0400 Received: from mout.gmx.net ([212.227.15.15]:39897 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726732AbeJXQjP (ORCPT ); Wed, 24 Oct 2018 12:39:15 -0400 Received: from [192.168.0.129] ([37.201.193.149]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LfCX2-1fmk9O06Aq-00okUK; Wed, 24 Oct 2018 10:12:06 +0200 Received: from [192.168.0.129] ([37.201.193.149]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LfCX2-1fmk9O06Aq-00okUK; Wed, 24 Oct 2018 10:12:06 +0200 Date: Wed, 24 Oct 2018 10:12:09 +0200 (DST) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: Junio C Hamano cc: Johannes Schindelin via GitGitGadget , git@vger.kernel.org, Duy Nguyen , Jeff King Subject: Re: [PATCH v3 1/3] repack: point out a bug handling stale shallow info In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US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D2zAV3WdFx1IOrvX19jLud5sSeo8pke2h7anrOZW yygAv79LFKxwTPaXYBFU8ACxpFKKcXDTt9S534mVbdA/s2Ni1o= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Junio, On Wed, 24 Oct 2018, Junio C Hamano wrote: > "Johannes Schindelin via GitGitGadget" > writes: > > > +... > > + d="$(git -C shallow-server rev-parse --verify D)" && > > + git -C shallow-server checkout master && > > + > > +... > > + ! grep $d shallow-client/.git/shallow && > > We know D (and $d) is not a tag, Actually, it is... the `test_commit D` creates that tag, and that is what I use here. > but perhaps the place that assigns to $d (way above) can do the > rev-parse of D^0, not D, to make it more clear what is going on, > especially given that... ... that the `grep` really wants to test for the absence of the *commit*, not the *tag* in .git/shallow? Yes, you are right ;-) So why did my test do the right thing, if it looked at a tag, but did not dereference it via ^0? The answer is: the `test_commit` function creates light-weight tags, i.e. no tag objects. And therefore, the $d^0 you found below, that's just confusing. I will change it so that the `rev-parse` call uses ^0 (even if it is technically not necessary), to avoid said confusion. Thanks, Dscho > > > + git -C shallow-server branch branch-orig D^0 && > > ... this does that D^0 thing here to makes us wonder if D needs > unwrapping before using it as a commit (not commit-ish). > > If we did so, we could use $d here instead of D^0. > > > + git -C shallow-client fetch --prune --depth=2 \ > > + origin "+refs/heads/*:refs/remotes/origin/*" > > +' > > + > > . "$TEST_DIRECTORY"/lib-httpd.sh > > start_httpd > >