Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-sticky range selection diff #3869

Merged
merged 15 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
stefanhaller committed Aug 28, 2024
commit b07ce19b9a3f1eb7b965fe85ac4de5df6ce7779e
2 changes: 1 addition & 1 deletion pkg/gui/controllers/helpers/diff_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
6 changes: 3 additions & 3 deletions pkg/integration/tests/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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"))
},
})
4 changes: 2 additions & 2 deletions pkg/integration/tests/diff/diff_and_apply_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down