Skip to content

Commit d1b8318

Browse files
committed
Remove the "YOU ARE HERE" marker
Now that we have sections, it is no longer needed. Keep the "<-- CONFLICTS" marker though.
1 parent f803fe7 commit d1b8318

37 files changed

+75
-129
lines changed

Diff for: pkg/gui/context/local_commits_context.go

-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
4141
}
4242
}
4343

44-
showYouAreHereLabel := c.Model().WorkingTreeStateAtLastCommitRefresh.CanShowTodos()
4544
hasRebaseUpdateRefsConfig := c.Git().Config.GetRebaseUpdateRefs()
4645

4746
return presentation.GetCommitListDisplayStrings(
@@ -63,7 +62,6 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
6362
endIdx,
6463
shouldShowGraph(c),
6564
c.Model().BisectInfo,
66-
showYouAreHereLabel,
6765
)
6866
}
6967

Diff for: pkg/gui/context/sub_commits_context.go

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func NewSubCommitsContext(
7777
endIdx,
7878
shouldShowGraph(c),
7979
git_commands.NewNullBisectInfo(),
80-
false,
8180
)
8281
}
8382

Diff for: pkg/gui/presentation/commits.go

+2-16
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func GetCommitListDisplayStrings(
5656
endIdx int,
5757
showGraph bool,
5858
bisectInfo *git_commands.BisectInfo,
59-
showYouAreHereLabel bool,
6059
) [][]string {
6160
mutex.Lock()
6261
defer mutex.Unlock()
@@ -185,11 +184,6 @@ func GetCommitListDisplayStrings(
185184
for i, commit := range filteredCommits {
186185
unfilteredIdx := i + startIdx
187186
bisectStatus = getBisectStatus(unfilteredIdx, commit.Hash, bisectInfo, bisectBounds)
188-
isYouAreHereCommit := false
189-
if showYouAreHereLabel && (commit.Status == models.StatusConflicted || unfilteredIdx == rebaseOffset) {
190-
isYouAreHereCommit = true
191-
showYouAreHereLabel = false
192-
}
193187
isMarkedBaseCommit := commit.Hash != "" && commit.Hash == markedBaseCommit
194188
if isMarkedBaseCommit {
195189
willBeRebased = true
@@ -211,7 +205,6 @@ func GetCommitListDisplayStrings(
211205
fullDescription,
212206
bisectStatus,
213207
bisectInfo,
214-
isYouAreHereCommit,
215208
))
216209
}
217210
return lines
@@ -364,7 +357,6 @@ func displayCommit(
364357
fullDescription bool,
365358
bisectStatus BisectStatus,
366359
bisectInfo *git_commands.BisectInfo,
367-
isYouAreHereCommit bool,
368360
) []string {
369361
bisectString := getBisectStatusText(bisectStatus, bisectInfo)
370362

@@ -427,14 +419,8 @@ func displayCommit(
427419
}
428420

429421
mark := ""
430-
if isYouAreHereCommit {
431-
color := style.FgYellow
432-
text := common.Tr.YouAreHere
433-
if commit.Status == models.StatusConflicted {
434-
color = style.FgRed
435-
text = common.Tr.ConflictLabel
436-
}
437-
youAreHere := color.Sprintf("<-- %s ---", text)
422+
if commit.Status == models.StatusConflicted {
423+
youAreHere := style.FgRed.Sprintf("<-- %s ---", common.Tr.ConflictLabel)
438424
mark = fmt.Sprintf("%s ", youAreHere)
439425
} else if isMarkedBaseCommit {
440426
rebaseFromHere := style.FgYellow.Sprint(common.Tr.MarkedCommitMarker)

Diff for: pkg/gui/presentation/commits_test.go

+2-37
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
4040
endIdx int
4141
showGraph bool
4242
bisectInfo *git_commands.BisectInfo
43-
showYouAreHereLabel bool
4443
expected string
4544
focus bool
4645
}{
@@ -223,12 +222,11 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
223222
showGraph: true,
224223
bisectInfo: git_commands.NewNullBisectInfo(),
225224
cherryPickedCommitHashSet: set.New[string](),
226-
showYouAreHereLabel: true,
227225
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
228226
expected: formatExpected(`
229227
hash1 pick commit1
230228
hash2 pick commit2
231-
hash3 ◯ <-- YOU ARE HERE --- commit3
229+
hash3 ◯ commit3
232230
hash4 ◯ commit4
233231
hash5 ◯ commit5
234232
`),
@@ -247,11 +245,10 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
247245
showGraph: true,
248246
bisectInfo: git_commands.NewNullBisectInfo(),
249247
cherryPickedCommitHashSet: set.New[string](),
250-
showYouAreHereLabel: true,
251248
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
252249
expected: formatExpected(`
253250
hash2 pick commit2
254-
hash3 ◯ <-- YOU ARE HERE --- commit3
251+
hash3 ◯ commit3
255252
hash4 ◯ commit4
256253
hash5 ◯ commit5
257254
`),
@@ -270,7 +267,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
270267
showGraph: true,
271268
bisectInfo: git_commands.NewNullBisectInfo(),
272269
cherryPickedCommitHashSet: set.New[string](),
273-
showYouAreHereLabel: true,
274270
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
275271
expected: formatExpected(`
276272
hash4 ◯ commit4
@@ -291,7 +287,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
291287
showGraph: true,
292288
bisectInfo: git_commands.NewNullBisectInfo(),
293289
cherryPickedCommitHashSet: set.New[string](),
294-
showYouAreHereLabel: true,
295290
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
296291
expected: formatExpected(`
297292
hash1 pick commit1
@@ -312,7 +307,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
312307
showGraph: true,
313308
bisectInfo: git_commands.NewNullBisectInfo(),
314309
cherryPickedCommitHashSet: set.New[string](),
315-
showYouAreHereLabel: true,
316310
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
317311
expected: formatExpected(`
318312
hash5 ◯ commit5
@@ -332,33 +326,12 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
332326
showGraph: true,
333327
bisectInfo: git_commands.NewNullBisectInfo(),
334328
cherryPickedCommitHashSet: set.New[string](),
335-
showYouAreHereLabel: true,
336329
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
337330
expected: formatExpected(`
338331
hash1 pick commit1
339332
hash2 pick commit2
340333
`),
341334
},
342-
{
343-
testName: "don't show YOU ARE HERE label when not asked for (e.g. in branches panel)",
344-
commits: []*models.Commit{
345-
{Name: "commit1", Hash: "hash1", Parents: []string{"hash2"}, Action: todo.Pick},
346-
{Name: "commit2", Hash: "hash2", Parents: []string{"hash3"}},
347-
{Name: "commit3", Hash: "hash3", Parents: []string{"hash4"}},
348-
},
349-
startIdx: 0,
350-
endIdx: 3,
351-
showGraph: true,
352-
bisectInfo: git_commands.NewNullBisectInfo(),
353-
cherryPickedCommitHashSet: set.New[string](),
354-
showYouAreHereLabel: false,
355-
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
356-
expected: formatExpected(`
357-
hash1 pick commit1
358-
hash2 ◯ commit2
359-
hash3 ◯ commit3
360-
`),
361-
},
362335
{
363336
testName: "graph in divergence view - all commits visible",
364337
commits: []*models.Commit{
@@ -376,7 +349,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
376349
showGraph: true,
377350
bisectInfo: git_commands.NewNullBisectInfo(),
378351
cherryPickedCommitHashSet: set.New[string](),
379-
showYouAreHereLabel: false,
380352
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
381353
expected: formatExpected(`
382354
↓ hash1r ◯ commit1
@@ -406,7 +378,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
406378
showGraph: true,
407379
bisectInfo: git_commands.NewNullBisectInfo(),
408380
cherryPickedCommitHashSet: set.New[string](),
409-
showYouAreHereLabel: false,
410381
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
411382
expected: formatExpected(`
412383
↓ hash3r ◯ │ commit3
@@ -434,7 +405,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
434405
showGraph: true,
435406
bisectInfo: git_commands.NewNullBisectInfo(),
436407
cherryPickedCommitHashSet: set.New[string](),
437-
showYouAreHereLabel: false,
438408
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
439409
expected: formatExpected(`
440410
↓ hash1r ◯ commit1
@@ -461,7 +431,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
461431
showGraph: true,
462432
bisectInfo: git_commands.NewNullBisectInfo(),
463433
cherryPickedCommitHashSet: set.New[string](),
464-
showYouAreHereLabel: false,
465434
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
466435
expected: formatExpected(`
467436
↑ hash2l ⏣─╮ commit2
@@ -487,7 +456,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
487456
showGraph: true,
488457
bisectInfo: git_commands.NewNullBisectInfo(),
489458
cherryPickedCommitHashSet: set.New[string](),
490-
showYouAreHereLabel: false,
491459
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
492460
expected: formatExpected(`
493461
↓ hash1r ◯ commit1
@@ -508,7 +476,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
508476
showGraph: true,
509477
bisectInfo: git_commands.NewNullBisectInfo(),
510478
cherryPickedCommitHashSet: set.New[string](),
511-
showYouAreHereLabel: false,
512479
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
513480
expected: formatExpected(`
514481
↑ hash1l ◯ commit1
@@ -530,7 +497,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
530497
showGraph: true,
531498
bisectInfo: git_commands.NewNullBisectInfo(),
532499
cherryPickedCommitHashSet: set.New[string](),
533-
showYouAreHereLabel: false,
534500
now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
535501
expected: formatExpected(`
536502
↓ hash1r ◯ commit1
@@ -596,7 +562,6 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
596562
s.endIdx,
597563
s.showGraph,
598564
s.bisectInfo,
599-
s.showYouAreHereLabel,
600565
)
601566

602567
renderedLines, _ := utils.RenderDisplayStrings(result, nil)

Diff for: pkg/i18n/english.go

-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ type TranslationSet struct {
337337
PullRequestNoUpstream string
338338
ErrorOccurred string
339339
NoRoom string
340-
YouAreHere string
341340
ConflictLabel string
342341
PendingRebaseTodosSectionHeader string
343342
PendingCherryPicksSectionHeader string
@@ -1396,7 +1395,6 @@ func EnglishTranslationSet() *TranslationSet {
13961395
PullRequestNoUpstream: "Cannot open a pull request for a branch with no upstream",
13971396
ErrorOccurred: "An error occurred! Please create an issue at",
13981397
NoRoom: "Not enough room",
1399-
YouAreHere: "YOU ARE HERE",
14001398
ConflictLabel: "CONFLICT",
14011399
PendingRebaseTodosSectionHeader: "Pending rebase todos",
14021400
PendingCherryPicksSectionHeader: "Pending cherry-picks",

Diff for: pkg/integration/tests/cherry_pick/cherry_pick_during_rebase.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
6262
Contains("--- Pending rebase todos ---"),
6363
Contains("pick CI two"),
6464
Contains("--- Commits ---"),
65-
Contains(" CI <-- YOU ARE HERE --- one").IsSelected(),
65+
Contains(" CI one").IsSelected(),
6666
Contains(" CI base"),
6767
).
6868
Press(keys.Commits.PasteCommits).
@@ -79,7 +79,7 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
7979
Contains("--- Pending rebase todos ---"),
8080
Contains("pick CI two"),
8181
Contains("--- Commits ---"),
82-
Contains(" CI <-- YOU ARE HERE --- three"),
82+
Contains(" CI three"),
8383
Contains(" CI one"),
8484
Contains(" CI base"),
8585
).

Diff for: pkg/integration/tests/interactive_rebase/advanced_interactive_rebase.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,23 @@ var AdvancedInteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
4848
Contains("--- Pending rebase todos ---"),
4949
Contains(TOP_COMMIT),
5050
Contains("--- Commits ---"),
51-
Contains(BASE_COMMIT).Contains("YOU ARE HERE"),
51+
Contains(BASE_COMMIT),
5252
).
5353
NavigateToLine(Contains(TOP_COMMIT)).
5454
Press(keys.Universal.Edit).
5555
Lines(
5656
Contains("--- Pending rebase todos ---"),
5757
Contains(TOP_COMMIT).Contains("edit"),
5858
Contains("--- Commits ---"),
59-
Contains(BASE_COMMIT).Contains("YOU ARE HERE"),
59+
Contains(BASE_COMMIT),
6060
).
6161
Tap(func() {
6262
t.Common().ContinueRebase()
6363
}).
6464
Lines(
6565
Contains("--- Pending rebase todos ---"),
6666
Contains("--- Commits ---"),
67-
Contains(TOP_COMMIT).Contains("YOU ARE HERE"),
67+
Contains(TOP_COMMIT),
6868
Contains(BASE_COMMIT),
6969
)
7070
},

Diff for: pkg/integration/tests/interactive_rebase/amend_head_commit_during_rebase.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
2727
Contains("--- Pending rebase todos ---"),
2828
Contains("commit 03"),
2929
Contains("--- Commits ---"),
30-
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
30+
Contains("commit 02").IsSelected(),
3131
Contains("commit 01"),
3232
)
3333

@@ -53,7 +53,7 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
5353
Contains("--- Pending rebase todos ---"),
5454
Contains("commit 03"),
5555
Contains("--- Commits ---"),
56-
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
56+
Contains("commit 02").IsSelected(),
5757
Contains("commit 01"),
5858
)
5959

Diff for: pkg/integration/tests/interactive_rebase/amend_non_head_commit_during_rebase.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var AmendNonHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
2727
Contains("--- Pending rebase todos ---"),
2828
Contains("commit 03"),
2929
Contains("--- Commits ---"),
30-
Contains("<-- YOU ARE HERE --- commit 02"),
30+
Contains("commit 02"),
3131
Contains("commit 01"),
3232
)
3333

Diff for: pkg/integration/tests/interactive_rebase/delete_update_ref_todo.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var DeleteUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
3434
Contains("pick").Contains("CI commit 03"),
3535
Contains("pick").Contains("CI commit 02"),
3636
Contains("--- Commits ---"),
37-
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
37+
Contains("CI ◯ commit 01"),
3838
).
3939
NavigateToLine(Contains("update-ref")).
4040
Press(keys.Universal.Remove).
@@ -52,7 +52,7 @@ var DeleteUpdateRefTodo = NewIntegrationTest(NewIntegrationTestArgs{
5252
Contains("pick").Contains("CI commit 03").IsSelected(),
5353
Contains("pick").Contains("CI commit 02"),
5454
Contains("--- Commits ---"),
55-
Contains("CI ◯ <-- YOU ARE HERE --- commit 01"),
55+
Contains("CI ◯ commit 01"),
5656
).
5757
NavigateToLine(Contains("commit 02")).
5858
Press(keys.Universal.Remove).

Diff for: pkg/integration/tests/interactive_rebase/dont_show_branch_heads_for_todo_items.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var DontShowBranchHeadsForTodoItems = NewIntegrationTest(NewIntegrationTestArgs{
4949
Contains("pick").Contains("CI commit 06"), // no star on this entry, even though branch2 points to it
5050
Contains("pick").Contains("CI commit 05"),
5151
Contains("--- Commits ---"),
52-
Contains("CI <-- YOU ARE HERE --- commit 04"),
52+
Contains("CI commit 04"),
5353
Contains("CI commit 03"),
5454
Contains("CI * commit 02"), // this star is fine though
5555
Contains("CI commit 01"),

Diff for: pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
4747
Contains("pick").Contains("CI commit 04"),
4848
Contains("pick").Contains("CI commit 03"),
4949
Contains("--- Commits ---"),
50-
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
50+
Contains("CI commit 02").IsSelected(),
5151
Contains("CI commit 01"),
5252
).
5353
NavigateToLine(Contains("commit 06")).

Diff for: pkg/integration/tests/interactive_rebase/edit_and_auto_amend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var EditAndAutoAmend = NewIntegrationTest(NewIntegrationTestArgs{
2828
Contains("--- Pending rebase todos ---"),
2929
Contains("commit 03"),
3030
Contains("--- Commits ---"),
31-
MatchesRegexp("YOU ARE HERE.*commit 02").IsSelected(),
31+
Contains("commit 02").IsSelected(),
3232
Contains("commit 01"),
3333
)
3434

Diff for: pkg/integration/tests/interactive_rebase/edit_first_commit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var EditFirstCommit = NewIntegrationTest(NewIntegrationTestArgs{
2727
Contains("--- Pending rebase todos ---"),
2828
Contains("commit 02"),
2929
Contains("--- Commits ---"),
30-
MatchesRegexp("YOU ARE HERE.*commit 01").IsSelected(),
30+
Contains("commit 01").IsSelected(),
3131
).
3232
Tap(func() {
3333
t.Common().ContinueRebase()

Diff for: pkg/integration/tests/interactive_rebase/edit_last_commit_of_stacked_branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var EditLastCommitOfStackedBranch = NewIntegrationTest(NewIntegrationTestArgs{
4242
Contains("pick").Contains("CI commit 04"),
4343
Contains("update-ref").Contains("branch1"),
4444
Contains("--- Commits ---"),
45-
Contains("<-- YOU ARE HERE --- * commit 03").IsSelected(),
45+
Contains("CI * commit 03").IsSelected(),
4646
Contains("CI commit 02"),
4747
Contains("CI commit 01"),
4848
)

Diff for: pkg/integration/tests/interactive_rebase/edit_non_todo_commit_during_rebase.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var EditNonTodoCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
2525
Lines(
2626
Contains("--- Pending rebase todos ---"),
2727
Contains("--- Commits ---"),
28-
Contains("<-- YOU ARE HERE --- commit 02"),
28+
Contains("commit 02"),
2929
Contains("commit 01"),
3030
).
3131
NavigateToLine(Contains("commit 01")).

0 commit comments

Comments
 (0)