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.
Switch between multiple log views (jesseduffield#3354)
- **PR Description** * Fixes jesseduffield#1363 * Allow switching between up two three log views Seeing as the last activity related to this issue was over a year ago, I decided to take a stab at this. The implementation should be fully backwards compatible. Simply add `allBranchesLogCmdAlt1` and/or `allBranchesLogCmdAlt2` to your config file to use them when cycling between log commands using 'a'. You can even use `allBranchesLogCmdAlt2` together with `allBranchesLogCmd` (skipping `allBranchesLogCmdAlt1`) if you want, it should not affect usability. This is my first contribution to LazyGit, but I have experience with Go. Changes: - Introduced two new optional user config commands, allBranchesLogCmdAlt1+2 - When pressing 'a' in the Status view, cycle between non-empty, non-identical log commands - There will always be at least one command to run, since allBranhesLogCmd has a default - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
- Loading branch information
Showing
8 changed files
with
65 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package status | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var LogCmd = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Cycle between two different log commands in the Status view", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) { | ||
config.UserConfig.Git.AllBranchesLogCmd = `echo "view1"` | ||
config.UserConfig.Git.AllBranchesLogCmds = []string{`echo "view2"`} | ||
}, | ||
SetupRepo: func(shell *Shell) {}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Status(). | ||
Focus(). | ||
Press(keys.Status.AllBranchesLogGraph) | ||
t.Views().Main().Content(Contains("view1")) | ||
|
||
t.Views().Status(). | ||
Focus(). | ||
Press(keys.Status.AllBranchesLogGraph) | ||
t.Views().Main().Content(Contains("view2").DoesNotContain("view1")) | ||
|
||
t.Views().Status(). | ||
Focus(). | ||
Press(keys.Status.AllBranchesLogGraph) | ||
t.Views().Main().Content(Contains("view1").DoesNotContain("view2")) | ||
}, | ||
}) |
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