Re: [PATCH v5 06/13] bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux