mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-25 18:55:28 -06:00
Update interactive rebase demo (#3392)
**PR Description** This is in anticipation of the new release which supports range-select. - **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) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] 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 -->
This commit is contained in:
commit
1337a943fe
@ -114,10 +114,12 @@ Press space on the selected line to stage it, or press `v` to start selecting a
|
|||||||
|
|
||||||
### Interactive Rebase
|
### Interactive Rebase
|
||||||
|
|
||||||
Press `e` on a commit to start an interactive rebase on it: causing all above commits to become part of the TODO file. Then squash (`s`), fixup (`f`), drop (`d`), edit (`e`), move up (`ctrl+i`) or move down (`ctrl+j`) any of TODO commits, before continuing the rebase by bringing up the rebase options menu with `m` and then selecting `continue`.
|
Press `i` to start an interactive rebase. Then squash (`s`), fixup (`f`), drop (`d`), edit (`e`), move up (`ctrl+i`) or move down (`ctrl+j`) any of TODO commits, before continuing the rebase by bringing up the rebase options menu with `m` and then selecting `continue`.
|
||||||
|
|
||||||
You can also perform any these actions as a once-off (e.g. pressing `s` on a commit to squash it) without explicitly starting a rebase.
|
You can also perform any these actions as a once-off (e.g. pressing `s` on a commit to squash it) without explicitly starting a rebase.
|
||||||
|
|
||||||
|
This demo also uses shift+down to select a range of commits to move and fixup.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Cherry-pick
|
### Cherry-pick
|
||||||
@ -314,6 +316,7 @@ Funtoo Linux has an autogenerated lazygit package in [dev-kit](https://github.co
|
|||||||
```sh
|
```sh
|
||||||
sudo emerge dev-vcs/lazygit
|
sudo emerge dev-vcs/lazygit
|
||||||
```
|
```
|
||||||
|
|
||||||
### Gentoo Linux
|
### Gentoo Linux
|
||||||
|
|
||||||
Lazygit is not (yet) in main Gentoo portage, however an ebuild is available in [GURU overlay](https://github.com/gentoo-mirror/guru/tree/master/dev-vcs/lazygit)
|
Lazygit is not (yet) in main Gentoo portage, however an ebuild is available in [GURU overlay](https://github.com/gentoo-mirror/guru/tree/master/dev-vcs/lazygit)
|
||||||
|
@ -131,12 +131,28 @@ func (self *InlineStatusHelper) stop(opts InlineStatusOpts) {
|
|||||||
info.stop <- struct{}{}
|
info.stop <- struct{}{}
|
||||||
delete(self.contextsWithInlineStatus, opts.ContextKey)
|
delete(self.contextsWithInlineStatus, opts.ContextKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.mutex.Unlock()
|
self.mutex.Unlock()
|
||||||
|
|
||||||
self.c.State().ClearItemOperation(opts.Item)
|
self.c.State().ClearItemOperation(opts.Item)
|
||||||
|
|
||||||
|
// When recording a demo we need to re-render the context again here to
|
||||||
|
// remove the inline status. In normal usage we don't want to do this
|
||||||
|
// because in the case of pushing a branch this would first reveal the ↑3↓7
|
||||||
|
// status from before the push for a brief moment, to be replaced by a green
|
||||||
|
// checkmark a moment later when the async refresh is done. This looks
|
||||||
|
// jarring, so normally we rely on the async refresh to redraw with the
|
||||||
|
// status removed. (In some rare cases, where there's no refresh at all, we
|
||||||
|
// need to redraw manually in the controller; see TagsController.push() for
|
||||||
|
// an example.)
|
||||||
|
//
|
||||||
|
// In demos, however, we turn all async refreshes into sync ones, because
|
||||||
|
// this looks better in demos. In this case the refresh happens while the
|
||||||
|
// status is still set, so we need to render again after removing it.
|
||||||
|
if self.c.InDemo() {
|
||||||
|
self.renderContext(opts.ContextKey)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *InlineStatusHelper) renderContext(contextKey types.ContextKey) {
|
func (self *InlineStatusHelper) renderContext(contextKey types.ContextKey) {
|
||||||
|
@ -397,6 +397,12 @@ func (self *ViewDriver) Press(keyStr string) *ViewDriver {
|
|||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *ViewDriver) Delay() *ViewDriver {
|
||||||
|
self.t.Wait(self.t.inputDelay)
|
||||||
|
|
||||||
|
return self
|
||||||
|
}
|
||||||
|
|
||||||
// for use when typing or navigating, because in demos we want that to happen
|
// for use when typing or navigating, because in demos we want that to happen
|
||||||
// faster
|
// faster
|
||||||
func (self *ViewDriver) PressFast(keyStr string) *ViewDriver {
|
func (self *ViewDriver) PressFast(keyStr string) *ViewDriver {
|
||||||
|
@ -14,12 +14,12 @@ var InteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
setDefaultDemoConfig(config)
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateFile("my-file.txt", "myfile content")
|
shell.CreateRepoHistory()
|
||||||
shell.CreateFile("my-other-file.rb", "my-other-file content")
|
|
||||||
|
|
||||||
shell.CreateNCommitsWithRandomMessages(60)
|
|
||||||
shell.NewBranch("feature/demo")
|
shell.NewBranch("feature/demo")
|
||||||
|
|
||||||
|
shell.CreateNCommitsWithRandomMessages(10)
|
||||||
|
|
||||||
shell.CloneIntoRemote("origin")
|
shell.CloneIntoRemote("origin")
|
||||||
|
|
||||||
shell.SetBranchUpstream("feature/demo", "origin/feature/demo")
|
shell.SetBranchUpstream("feature/demo", "origin/feature/demo")
|
||||||
@ -30,14 +30,18 @@ var InteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
|
|
||||||
t.Views().Commits().
|
t.Views().Commits().
|
||||||
IsFocused().
|
IsFocused().
|
||||||
NavigateToLine(Contains("Add TypeScript types to User module")).
|
Press(keys.Commits.StartInteractiveRebase).
|
||||||
Press(keys.Universal.Edit).
|
PressFast(keys.Universal.RangeSelectDown).
|
||||||
SelectPreviousItem().
|
PressFast(keys.Universal.RangeSelectDown).
|
||||||
Press(keys.Universal.Remove).
|
|
||||||
SelectPreviousItem().
|
|
||||||
Press(keys.Commits.SquashDown).
|
|
||||||
SelectPreviousItem().
|
|
||||||
Press(keys.Commits.MarkCommitAsFixup).
|
Press(keys.Commits.MarkCommitAsFixup).
|
||||||
|
PressFast(keys.Commits.MoveDownCommit).
|
||||||
|
PressFast(keys.Commits.MoveDownCommit).
|
||||||
|
Delay().
|
||||||
|
SelectNextItem().
|
||||||
|
SelectNextItem().
|
||||||
|
Press(keys.Universal.Remove).
|
||||||
|
SelectNextItem().
|
||||||
|
Press(keys.Commits.SquashDown).
|
||||||
Press(keys.Universal.CreateRebaseOptionsMenu).
|
Press(keys.Universal.CreateRebaseOptionsMenu).
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.ExpectPopup().Menu().
|
t.ExpectPopup().Menu().
|
||||||
|
Loading…
Reference in New Issue
Block a user