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-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 1D5651F66E for ; Tue, 11 Aug 2020 18:38:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726068AbgHKSiP (ORCPT ); Tue, 11 Aug 2020 14:38:15 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:54040 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbgHKSiO (ORCPT ); Tue, 11 Aug 2020 14:38:14 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 2EDBDF25AC; Tue, 11 Aug 2020 14:38:11 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=S1gANu0jVkuENjx+gKc+Ys4P5s8=; b=r4f4yz ixj0mQwHBG9F/eu9ufD542DGwOZIzF4CfjadgJA/kXYWuERTEs4vfyLJ/QcWfDZr zM+hWFht9gfxnwxJZxfUP4AmyvFLxnV+CjbOJ2CkVuPKYqbhHBxlIxnWebze/VUe XkVy7MQcawRliOBdsZVlNhwyEEoErWDpZiXDs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=u3e7wp/jHthOjnNwdi52tvph1TCyjhTr zxo2jPjZWSzDR1JG8s6S9zEKPTw4VuJUf6ExewjCEL+deGA4WSb3XfdKN2LDXD6T Zm6kVUCw9tyKFHBB24JrrJdtH55aaQH7oxgUFM0ybpebglpprRIjGV4DZ+JLB1YB UzWqklZM9S8= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 27290F25AB; Tue, 11 Aug 2020 14:38:11 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 67B7DF25AA; Tue, 11 Aug 2020 14:38:08 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Han-Wen Nienhuys Cc: Han-Wen Nienhuys via GitGitGadget , git , Han-Wen Nienhuys Subject: Re: [PATCH v3 0/3] Remove special casing for PSEUDOREF updates References: Date: Tue, 11 Aug 2020 11:38:06 -0700 In-Reply-To: (Han-Wen Nienhuys's message of "Tue, 11 Aug 2020 12:49:59 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: CD39499A-DC01-11EA-9949-843F439F7C89-77302942!pb-smtp21.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Han-Wen Nienhuys writes: > On Mon, Aug 10, 2020 at 6:04 PM Junio C Hamano wrote: >> >> Han-Wen Nienhuys writes: >> >> > Dealing with FETCH_HEAD generically isn't possible unless we extend >> > the API of the ref backend: the generic ref_store instance doesn't >> > offer a way to get at the path that corresponds to FETCH_HEAD, so we >> > can't handle it in refs_read_raw_ref(). In the current reftable >> > series, FETCH_HEAD is dealt with in the backends separately. >> >> I am not sure what the best way would be, but I do not think any >> existing code writes into it using the refs API at all, even though >> it may be read only for the first object name using the refs API. >> >> And I am not sure if we want to extend the write side API so that >> the callers can express the full flexibility of that single file. > > That's not what I am getting at. I am just interested in how to handle > FETCH_HEAD in refs_read_raw_ref. > >> So perhaps the best way forward would be to ensure that anybody who >> tries to read from FETCH_HEAD using the ref API reads the first >> object name in it from $GIT_DIR/FETCH_HEAD file as we've always done >> since the beginning of time, regardless of what ref backend is used, > > Right, but how do we get at the value of $GIT_DIR given a struct > ref_store? We can either push that out to the ref store backend, > because each backend knows what $GIT_DIR is, or we can make $GIT_DIR a > property of the generic ref_store. > > I suppose it's cleaner to make the latter API extension. Yup. Sounds like the right direction to go. Thanks.