Don't call the selected commit "current" before bisecting starts

After marking the first commit as good or bad, the bisect menu's
entries act on the selected commit until git knows both a good and a
bad commit. They called it the "current commit" though, as if it was
the commit that git wants the user to test.

Call it "commit <hash>" instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Stefan Haller
2026-10-31 11:27:58 +01:00
co-authored by Claude Opus 5.5
parent 9761cec61a
commit eef08f04ec
3 changed files with 15 additions and 16 deletions
+9 -7
View File
@@ -63,18 +63,20 @@ func (self *BisectController) openMenu(commit *models.Commit) error {
// a bad commit yet. Its entries act on the selected commit.
func (self *BisectController) openMenuBeforeBisecting(info *git_commands.BisectInfo, commit *models.Commit) error {
disabledReason := self.require(self.singleItemSelected())()
ref := utils.ResolvePlaceholderString(self.c.Tr.Bisect.CommitRef,
map[string]string{"hash": commit.ShortHash()})
markLabel := func(term string) string {
return utils.ResolvePlaceholderString(self.c.Tr.Bisect.MarkRef,
map[string]string{"ref": ref, "term": term})
}
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.Bisect.BisectMenuTitle,
Items: []*types.MenuItem{
self.markMenuItem(
fmt.Sprintf(self.c.Tr.Bisect.Mark, commit.ShortHash(), info.NewTerm()),
commit.Hash(), info.NewTerm(), disabledReason, 'b'),
self.markMenuItem(
fmt.Sprintf(self.c.Tr.Bisect.Mark, commit.ShortHash(), info.OldTerm()),
commit.Hash(), info.OldTerm(), disabledReason, 'g'),
self.markMenuItem(markLabel(info.NewTerm()), commit.Hash(), info.NewTerm(), disabledReason, 'b'),
self.markMenuItem(markLabel(info.OldTerm()), commit.Hash(), info.OldTerm(), disabledReason, 'g'),
self.skipMenuItem(
fmt.Sprintf(self.c.Tr.Bisect.SkipCurrent, commit.ShortHash()),
utils.ResolvePlaceholderString(self.c.Tr.Bisect.SkipRef, map[string]string{"ref": ref}),
commit.Hash(), types.KeepCommitSelectionByHash, disabledReason, 's'),
self.resetMenuItem(),
},
+6
View File
@@ -1048,8 +1048,11 @@ type Bisect struct {
NewTermPrompt string
BisectMenuTitle string
Mark string
MarkRef string
SkipCurrent string
SkipSelected string
SkipRef string
CommitRef string
CompleteTitle string
CompletePrompt string
CompletePromptIndeterminate string
@@ -2374,6 +2377,9 @@ func EnglishTranslationSet() *TranslationSet {
MarkStart: "Mark %s as %s (start bisect)",
SkipCurrent: "Skip current commit (%s)",
SkipSelected: "Skip selected commit (%s)",
MarkRef: "Mark {{.ref}} as {{.term}}",
SkipRef: "Skip {{.ref}}",
CommitRef: "commit {{.hash}}",
ResetTitle: "Reset 'git bisect'",
ResetPrompt: "Are you sure you want to reset 'git bisect'?",
ResetOption: "Reset bisect",
-9
View File
@@ -30,7 +30,6 @@ var Skip = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Menu().Title(Equals("Bisect")).
// There's no current commit yet, so the entries act on the
// selected commit:
/* EXPECTED:
Lines(
Contains("b Mark commit").Contains("as bad"),
Contains("g Mark commit").Contains("as good"),
@@ -38,14 +37,6 @@ var Skip = NewIntegrationTest(NewIntegrationTestArgs{
Contains("r Reset bisect"),
Contains("Cancel"),
).
ACTUAL: */
Lines(
Contains("b Mark current commit").Contains("as bad"),
Contains("g Mark current commit").Contains("as good"),
Contains("s Skip current commit"),
Contains("r Reset bisect"),
Contains("Cancel"),
).
Select(MatchesRegexp(`Mark .* as good`)).Confirm()
t.Views().Information().Content(Contains("Bisecting"))
}).