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,NICE_REPLY_C,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 58F0A1F5AE for ; Sat, 25 Jul 2020 00:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726942AbgGYATg (ORCPT ); Fri, 24 Jul 2020 20:19:36 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:51387 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726592AbgGYATg (ORCPT ); Fri, 24 Jul 2020 20:19:36 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 2D2A4DF00F; Fri, 24 Jul 2020 20:19:34 -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:message-id:mime-version:content-type; s=sasl; bh=LrXHoEtmGJNYRRMSpz6heQG1LkM=; b=djZSDrLYzx+mO7wkC1E3 Ryy26a3/Dg4a679l0tOSuGa4PyikgZjVOhqCUJGy0nj3zRi5KbTGxz9J/NVZZ/xc vzXVr/ejO5WMH45ZVA6tfN7sFOSJ80eYfsxIYAn/rWcbVWMfDpns46k3iODwoRMy C6sgbimkJaUB1NEa52jKH2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:message-id:mime-version:content-type; q=dns; s=sasl; b=OCAqG3D8nj9Wy3mB2IriIpsebLB05FXdyEP40GUk1piYw4 RT+ILvmFIeeyXjgexfEkhKpxzEbrHKHPKaWc8iyRtMGsCIzT7sI1xr9SGtUtv+Qi ZAyb1f+b4Vsab7LfyXPUYQlBaYw7TvcRXBCUoeh7aShengoQlCIVxy3ZURtfA= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 183A3DF00E; Fri, 24 Jul 2020 20:19:34 -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 1B681DF00B; Fri, 24 Jul 2020 20:19:30 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Miriam Rubio Cc: git@vger.kernel.org, Pranit Bauva , Lars Schneider , Christian Couder , Johannes Schindelin , Tanushree Tumane Subject: Re: [PATCH v5 06/13] bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C References: <20200717105406.82226-1-mirucam@gmail.com> <20200717105406.82226-7-mirucam@gmail.com> Date: Fri, 24 Jul 2020 17:19:28 -0700 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: 81D3B704-CE0C-11EA-93BA-843F439F7C89-77302942!pb-smtp21.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Junio C Hamano writes: > The ref API is getting updated so that the 40-hex files whose names > are all capital and ends with _HEAD are being converted from "files > that happen to record 40-hex" to "refs that live at the toplevel > outside refs/ hierarchy". Checking with > > no_checkout = ref_exists("BISECT_HEAD"); > > would work in both old and new worlds, hopefully. > > Similarly, if the new code you are writing reads directly from > git_path_bisect_head(), write into it, or unlink it, these accesses > should be replaced with calls to refs API (e.g. you already do so in > your bisect_state() helper where you use get_oid() on the refname, > not read from the file). In the meantime, I have applied the following fix-up on top of these 13 patches, but when the topic gets rerolled (as we are in the feature freeze before the upcoming release, there is no need to hurry till the end of the month, though), I'd rather want to see the new use of file_exists(git_path_bisect_head()) disappear. As it stands as a 14-patch series, the series would instead end up with us making a mistake to introduce new use of git_path_bisect_head() at step 06/14 and then later realize the mistake and fix it at step 14/14, which would be a waste of time for future readers of the code. Thanks. -- >8 -- Subject: SQUASH??? do not add new users of git_path_bisect_head() --- builtin/bisect--helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index 20d359b2ca..eb3d30389b 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -572,7 +572,7 @@ static enum bisect_error bisect_next(struct bisect_terms *terms, const char *pre if (bisect_next_check(terms, terms->term_good)) return BISECT_FAILED; - no_checkout = file_exists(git_path_bisect_head()); + no_checkout = ref_exists("BISECT_HEAD"); /* Perform all bisection computation, display and checkout */ res = bisect_next_all(the_repository, prefix, no_checkout); -- 2.28.0-rc1