From b07ce19b9a3f1eb7b965fe85ac4de5df6ce7779e Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 25 Aug 2024 14:04:54 +0200 Subject: [PATCH] Add --stat -p to diff args in diffing mode This is consistent with what we do for showing single commits (with git show), and I find it very useful. --- pkg/gui/controllers/helpers/diff_helper.go | 2 +- pkg/integration/tests/diff/diff.go | 6 +++--- pkg/integration/tests/diff/diff_and_apply_patch.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/gui/controllers/helpers/diff_helper.go b/pkg/gui/controllers/helpers/diff_helper.go index a80fb0292..1aad725fc 100644 --- a/pkg/gui/controllers/helpers/diff_helper.go +++ b/pkg/gui/controllers/helpers/diff_helper.go @@ -22,7 +22,7 @@ func NewDiffHelper(c *HelperCommon) *DiffHelper { } func (self *DiffHelper) DiffArgs() []string { - output := []string{self.c.Modes().Diffing.Ref} + output := []string{"--stat", "-p", self.c.Modes().Diffing.Ref} right := self.currentDiffTerminal() if right != "" { diff --git a/pkg/integration/tests/diff/diff.go b/pkg/integration/tests/diff/diff.go index ef1eb40a6..06e320418 100644 --- a/pkg/integration/tests/diff/diff.go +++ b/pkg/integration/tests/diff/diff.go @@ -35,11 +35,11 @@ var Diff = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Branches(). IsFocused(). Tap(func() { - t.Views().Information().Content(Contains("Showing output for: git diff branch-a branch-a")) + t.Views().Information().Content(Contains("Showing output for: git diff --stat -p branch-a branch-a")) }). SelectNextItem(). Tap(func() { - t.Views().Information().Content(Contains("Showing output for: git diff branch-a branch-b")) + t.Views().Information().Content(Contains("Showing output for: git diff --stat -p branch-a branch-b")) t.Views().Main().Content(Contains("+second line")) }). PressEnter() @@ -67,7 +67,7 @@ var Diff = NewIntegrationTest(NewIntegrationTestArgs{ Press(keys.Universal.DiffingMenu) t.ExpectPopup().Menu().Title(Equals("Diffing")).Select(Contains("Reverse diff direction")).Confirm() - t.Views().Information().Content(Contains("Showing output for: git diff branch-a branch-b -R")) + t.Views().Information().Content(Contains("Showing output for: git diff --stat -p branch-a branch-b -R")) t.Views().Main().Content(Contains("-second line")) }, }) diff --git a/pkg/integration/tests/diff/diff_and_apply_patch.go b/pkg/integration/tests/diff/diff_and_apply_patch.go index c0c95cc17..6801e7bea 100644 --- a/pkg/integration/tests/diff/diff_and_apply_patch.go +++ b/pkg/integration/tests/diff/diff_and_apply_patch.go @@ -32,13 +32,13 @@ var DiffAndApplyPatch = NewIntegrationTest(NewIntegrationTestArgs{ t.ExpectPopup().Menu().Title(Equals("Diffing")).Select(Equals("Diff branch-a")).Confirm() - t.Views().Information().Content(Contains("Showing output for: git diff branch-a branch-a")) + t.Views().Information().Content(Contains("Showing output for: git diff --stat -p branch-a branch-a")) t.Views().Branches(). IsFocused(). SelectNextItem(). Tap(func() { - t.Views().Information().Content(Contains("Showing output for: git diff branch-a branch-b")) + t.Views().Information().Content(Contains("Showing output for: git diff --stat -p branch-a branch-b")) t.Views().Main().Content(Contains("+second line")) }). PressEnter()