From 6402c830d5257253d8496713d9cd3a26b2216e84 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 27 Apr 2025 21:34:24 +0200 Subject: [PATCH] Remove space after rebase todo This is very old; I can only guess that this was added at a time where today's list column handling wasn't in place yet, so the space was needed to separate columns. This now causes a gap of two spaces between the rebase todo column and the author column, which I'm sure wasn't intended. Funny that I never noticed. --- pkg/gui/presentation/commits.go | 2 +- pkg/gui/presentation/commits_test.go | 26 +++++++++---------- .../cherry_pick/cherry_pick_during_rebase.go | 14 +++++----- ...nge_select_down_to_merge_outside_rebase.go | 20 +++++++------- .../edit_range_select_outside_rebase.go | 16 ++++++------ 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go index f265979da..116ad5c50 100644 --- a/pkg/gui/presentation/commits.go +++ b/pkg/gui/presentation/commits.go @@ -387,7 +387,7 @@ func displayCommit( actionString := "" if commit.Action != models.ActionNone { - actionString = actionColorMap(commit.Action, commit.Status).Sprint(commit.Action.String()) + " " + actionString = actionColorMap(commit.Action, commit.Status).Sprint(commit.Action.String()) } tagString := "" diff --git a/pkg/gui/presentation/commits_test.go b/pkg/gui/presentation/commits_test.go index 58a2c2032..08bd3a19c 100644 --- a/pkg/gui/presentation/commits_test.go +++ b/pkg/gui/presentation/commits_test.go @@ -224,11 +224,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) { cherryPickedCommitHashSet: set.New[string](), now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), expected: formatExpected(` - hash1 pick commit1 - hash2 pick commit2 - hash3 ◯ commit3 - hash4 ◯ commit4 - hash5 ◯ commit5 + hash1 pick commit1 + hash2 pick commit2 + hash3 ◯ commit3 + hash4 ◯ commit4 + hash5 ◯ commit5 `), }, { @@ -247,10 +247,10 @@ func TestGetCommitListDisplayStrings(t *testing.T) { cherryPickedCommitHashSet: set.New[string](), now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), expected: formatExpected(` - hash2 pick commit2 - hash3 ◯ commit3 - hash4 ◯ commit4 - hash5 ◯ commit5 + hash2 pick commit2 + hash3 ◯ commit3 + hash4 ◯ commit4 + hash5 ◯ commit5 `), }, { @@ -289,8 +289,8 @@ func TestGetCommitListDisplayStrings(t *testing.T) { cherryPickedCommitHashSet: set.New[string](), now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), expected: formatExpected(` - hash1 pick commit1 - hash2 pick commit2 + hash1 pick commit1 + hash2 pick commit2 `), }, { @@ -328,8 +328,8 @@ func TestGetCommitListDisplayStrings(t *testing.T) { cherryPickedCommitHashSet: set.New[string](), now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC), expected: formatExpected(` - hash1 pick commit1 - hash2 pick commit2 + hash1 pick commit1 + hash2 pick commit2 `), }, { diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go b/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go index bd64a7469..7974995df 100644 --- a/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go +++ b/pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go @@ -60,10 +60,10 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{ Press(keys.Universal.Edit). Lines( Contains("--- Pending rebase todos ---"), - Contains("pick CI two"), + Contains("pick CI two"), Contains("--- Commits ---"), - Contains(" CI one").IsSelected(), - Contains(" CI base"), + Contains(" CI one").IsSelected(), + Contains(" CI base"), ). Press(keys.Commits.PasteCommits). Tap(func() { @@ -77,11 +77,11 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{ }). Lines( Contains("--- Pending rebase todos ---"), - Contains("pick CI two"), + Contains("pick CI two"), Contains("--- Commits ---"), - Contains(" CI three"), - Contains(" CI one"), - Contains(" CI base"), + Contains(" CI three"), + Contains(" CI one"), + Contains(" CI base"), ). Tap(func() { t.Common().ContinueRebase() diff --git a/pkg/integration/tests/interactive_rebase/edit_range_select_down_to_merge_outside_rebase.go b/pkg/integration/tests/interactive_rebase/edit_range_select_down_to_merge_outside_rebase.go index ffb92a4c5..4a6135b28 100644 --- a/pkg/integration/tests/interactive_rebase/edit_range_select_down_to_merge_outside_rebase.go +++ b/pkg/integration/tests/interactive_rebase/edit_range_select_down_to_merge_outside_rebase.go @@ -28,17 +28,17 @@ var EditRangeSelectDownToMergeOutsideRebase = NewIntegrationTest(NewIntegrationT Press(keys.Universal.Edit). Lines( Contains("--- Pending rebase todos ---"), - Contains("edit CI commit 02").IsSelected(), - Contains("edit CI commit 01").IsSelected(), + Contains("edit CI commit 02").IsSelected(), + Contains("edit CI commit 01").IsSelected(), Contains("--- Commits ---").IsSelected(), - Contains(" CI ⏣─╮ Merge branch 'second-change-branch' into first-change-branch").IsSelected(), - Contains(" CI │ ◯ * second-change-branch unrelated change"), - Contains(" CI │ ◯ second change"), - Contains(" CI ◯ │ first change"), - Contains(" CI ◯─╯ * original"), - Contains(" CI ◯ three"), - Contains(" CI ◯ two"), - Contains(" CI ◯ one"), + Contains(" CI ⏣─╮ Merge branch 'second-change-branch' into first-change-branch").IsSelected(), + Contains(" CI │ ◯ * second-change-branch unrelated change"), + Contains(" CI │ ◯ second change"), + Contains(" CI ◯ │ first change"), + Contains(" CI ◯─╯ * original"), + Contains(" CI ◯ three"), + Contains(" CI ◯ two"), + Contains(" CI ◯ one"), ) }, }) diff --git a/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go b/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go index 93baafbab..a86a5f0e2 100644 --- a/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go +++ b/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go @@ -38,15 +38,15 @@ var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{ Press(keys.Universal.Edit). Lines( Contains("--- Pending rebase todos ---"), - Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(), - Contains("edit CI first change").IsSelected(), - Contains("edit CI * second-change-branch unrelated change").IsSelected(), - Contains("edit CI second change").IsSelected(), - Contains("edit CI * original").IsSelected(), + Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(), + Contains("edit CI first change").IsSelected(), + Contains("edit CI * second-change-branch unrelated change").IsSelected(), + Contains("edit CI second change").IsSelected(), + Contains("edit CI * original").IsSelected(), Contains("--- Commits ---").IsSelected(), - Contains(" CI ◯ three").IsSelected(), - Contains(" CI ◯ two"), - Contains(" CI ◯ one"), + Contains(" CI ◯ three").IsSelected(), + Contains(" CI ◯ two"), + Contains(" CI ◯ one"), ) }, })