forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compare-commits demo (jesseduffield#2929)
- Loading branch information
Showing
18 changed files
with
99 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package demo | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Diff two commits", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
IsDemo: true, | ||
SetupConfig: func(config *config.AppConfig) { | ||
setDefaultDemoConfig(config) | ||
|
||
config.UserConfig.Gui.ShowFileTree = false | ||
config.UserConfig.Gui.ShowCommandLog = false | ||
}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.CreateNCommitsWithRandomMessages(50) | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.SetCaptionPrefix("Compare two commits") | ||
t.Wait(1000) | ||
|
||
t.Views().Commits(). | ||
Focus(). | ||
NavigateToLine(Contains("Replace deprecated lifecycle methods in React components")). | ||
Wait(1000). | ||
Press(keys.Universal.DiffingMenu). | ||
Tap(func() { | ||
t.ExpectPopup().Menu(). | ||
Title(Equals("Diffing")). | ||
TopLines( | ||
MatchesRegexp(`Diff .*`), | ||
). | ||
Wait(500). | ||
Confirm() | ||
}). | ||
NavigateToLine(Contains("Move constants to a separate config file")). | ||
Wait(1000). | ||
PressEnter() | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package demo | ||
|
||
import "github.com/jesseduffield/lazygit/pkg/config" | ||
|
||
// Gives us nicer colours when we generate a git repo history with `shell.CreateRepoHistory()` | ||
func setGeneratedAuthorColours(config *config.AppConfig) { | ||
config.UserConfig.Gui.AuthorColors = map[string]string{ | ||
"Fredrica Greenhill": "#fb5aa3", | ||
"Oscar Reuenthal": "#86c82f", | ||
"Paul Oberstein": "#ffd500", | ||
"Siegfried Kircheis": "#fe7e11", | ||
"Yang Wen-li": "#8e3ccb", | ||
} | ||
} | ||
|
||
func setDefaultDemoConfig(config *config.AppConfig) { | ||
// demos look much nicers with icons shown | ||
config.UserConfig.Gui.NerdFontsVersion = "3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters