All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 6/6] bisect: no longer try to clean up left-over `.git/head-name` files
Date: Thu, 15 Dec 2022 10:47:49 +0100	[thread overview]
Message-ID: <patch-6.6-2ad89aca728-20221215T094038Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.6-00000000000-20221215T094038Z-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.rc2.1048.g0e5493b8d5b


  parent reply	other threads:[~2022-12-15  9:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  9:47 [PATCH 0/6] bisect: follow-up fixes from js/bisect-in-c Ævar Arnfjörð Bjarmason
2022-12-15  9:47 ` [PATCH 1/6] bisect--helper: simplify exit code computation Ævar Arnfjörð Bjarmason
2022-12-15  9:47 ` [PATCH 2/6] bisect--helper: make the order consistently `argc, argv` Ævar Arnfjörð Bjarmason
2022-12-15  9:47 ` [PATCH 3/6] bisect: verify that a bogus option won't try to start a bisection Ævar Arnfjörð Bjarmason
2022-12-15  9:47 ` [PATCH 4/6] bisect run: fix the error message Ævar Arnfjörð Bjarmason
2022-12-15 15:08   ` Đoàn Trần Công Danh
2022-12-15  9:47 ` [PATCH 5/6] bisect: remove Cogito-related code Ævar Arnfjörð Bjarmason
2022-12-15  9:47 ` Ævar Arnfjörð Bjarmason [this message]
2022-12-15 10:45 ` [PATCH 0/6] bisect: follow-up fixes from js/bisect-in-c Christian Couder
2023-01-12 15:19 ` [PATCH v2 " Ævar Arnfjörð Bjarmason
2023-01-12 15:19   ` [PATCH v2 1/6] bisect--helper: simplify exit code computation Ævar Arnfjörð Bjarmason
2023-01-12 15:19   ` [PATCH v2 2/6] bisect--helper: make the order consistently `argc, argv` Ævar Arnfjörð Bjarmason
2023-01-12 15:19   ` [PATCH v2 3/6] bisect: verify that a bogus option won't try to start a bisection Ævar Arnfjörð Bjarmason
2023-01-12 15:19   ` [PATCH v2 4/6] bisect run: fix the error message Ævar Arnfjörð Bjarmason
2023-01-12 15:19   ` [PATCH v2 5/6] bisect: remove Cogito-related code Ævar Arnfjörð Bjarmason
2023-01-12 15:19   ` [PATCH v2 6/6] bisect: no longer try to clean up left-over `.git/head-name` files Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-6.6-2ad89aca728-20221215T094038Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.