git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 6/6] bisect: no longer try to clean up left-over `.git/head-name` files

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 12, 2023, 15:19 UTC
Message-ID
<patch-v2-6.6-817fe726b4b-20230112T151651Z-avarab@gmail.com>
In-Reply-To
<cover-v2-0.6-00000000000-20230112T151651Z-avarab@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

As per the code comment, the `.git/head-name` files were cleaned up for backwards-compatibility: an old version of `git bisect` could have left them behind.

Now, just how old would such a version be? As of 0f497e75f05 (Eliminate confusing "won't bisect on seeked tree" failure, 2008-02-23), `git bisect` does not write that file anymore. Which corresponds to Git v1.5.4.4.

Even if the likelihood is non-nil that there might still be users out there who use such an old version to start a bisection, but then decide to continue bisecting with a current Git version, it is highly improbable.

So let's remove that code, at long last.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 bisect.c                    | 3 ---
 t/t6030-bisect-porcelain.sh | 1 -
 2 files changed, 4 deletions(-)
diff --git a/bisect.c b/bisect.c
index ec7487e6836..ef5ee5a6436 100644
--- a/bisect.c
+++ b/bisect.c
@@ -472,7 +472,6 @@ static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START")
 static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG")
 static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
 static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
-static GIT_PATH_FUNC(git_path_head_name, "head-name")
 
 static void read_bisect_paths(struct strvec *array)
 {
@@ -1188,8 +1187,6 @@ int bisect_clean_state(void)
 	unlink_or_warn(git_path_bisect_run());
 	unlink_or_warn(git_path_bisect_terms());
 	unlink_or_warn(git_path_bisect_first_parent());
-	/* Cleanup head-name if it got left by an old version of git-bisect */
-	unlink_or_warn(git_path_head_name());
 	/*
 	 * Cleanup BISECT_START last to support the --no-checkout option
 	 * introduced in the commit 4796e823a.
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 0a62ea2b3ce..3ba4fdf6153 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -1158,7 +1158,6 @@ test_expect_success 'git bisect reset cleans bisection state properly' '
 	test_path_is_missing ".git/BISECT_LOG" &&
 	test_path_is_missing ".git/BISECT_RUN" &&
 	test_path_is_missing ".git/BISECT_TERMS" &&
-	test_path_is_missing ".git/head-name" &&
 	test_path_is_missing ".git/BISECT_HEAD" &&
 	test_path_is_missing ".git/BISECT_START"
 '
-- 
2.39.0.1215.g1ba3f685d4f
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 15 of 16 in “bisect: follow-up fixes from js/bisect-in-c”
  1. 0/6 bisect: follow-up fixes from js/bisect-in-cÆvar Arnfjörð Bjarmason, Dec 15, 2022
  2. 1/6 bisect--helper: simplify exit code computationÆvar Arnfjörð Bjarmason, Dec 15, 2022
  3. 2/6 bisect--helper: make the order consistently `argc, argv`Ævar Arnfjörð Bjarmason, Dec 15, 2022
  4. 3/6 bisect: verify that a bogus option won't try to start a bisectionÆvar Arnfjörð Bjarmason, Dec 15, 2022
  5. 4/6 bisect run: fix the error messageÆvar Arnfjörð Bjarmason, Dec 15, 2022
  6. Đoàn Trần Công DanhDec 15, 2022
  7. 5/6 bisect: remove Cogito-related codeÆvar Arnfjörð Bjarmason, Dec 15, 2022
  8. 6/6 bisect: no longer try to clean up left-over `.git/head-name` filesÆvar Arnfjörð Bjarmason, Dec 15, 2022
  9. Christian CouderDec 15, 2022
  10. 0/6 bisect: follow-up fixes from js/bisect-in-cÆvar Arnfjörð Bjarmason, Jan 12, 2023
  11. 1/6 bisect--helper: simplify exit code computationÆvar Arnfjörð Bjarmason, Jan 12, 2023
  12. 2/6 bisect--helper: make the order consistently `argc, argv`Ævar Arnfjörð Bjarmason, Jan 12, 2023
  13. 3/6 bisect: verify that a bogus option won't try to start a bisectionÆvar Arnfjörð Bjarmason, Jan 12, 2023
  14. 5/6 bisect: remove Cogito-related codeÆvar Arnfjörð Bjarmason, Jan 12, 2023
  15. 6/6 bisect: no longer try to clean up left-over `.git/head-name` filesÆvar Arnfjörð Bjarmason, Jan 12, 2023
  16. 4/6 bisect run: fix the error messageÆvar Arnfjörð Bjarmason, Jan 12, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.