mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-01 13:17:53 +02:00
Add undo demo
This commit is contained in:
parent
0df5cb1286
commit
3ea81d4a6f
15
README.md
15
README.md
@ -129,6 +129,21 @@ Learn more in the [Rebase magic Youtube tutorial](https://youtu.be/4XaToVut_hs).
|
||||
|
||||
![custom_patch](../assets/demo/custom_patch-compressed.gif)
|
||||
|
||||
### Undo
|
||||
|
||||
You can undo the last action by pressing 'z' and redo with `ctrl+z`. Here we drop a couple of commits and then undo the actions.
|
||||
Undo uses the reflog which is specific to commits and branches so we can't undo changes to the working tree or stash.
|
||||
|
||||
[More info](/docs/Undoing.md)
|
||||
|
||||
![undo](../assets/demo/undo-compressed.gif)
|
||||
|
||||
### Commit graph
|
||||
|
||||
When viewing the commit graph in an enlarged window (use `+` and `_` to cycle window sizes), the commit graph is shown. Colours correspond to the commit authors, and as you navigate down the graph, the parent commits of the selected commit are highlighted.
|
||||
|
||||
![commit_graph](../assets/demo/commit_graph-compressed.gif)
|
||||
|
||||
## Tutorials
|
||||
|
||||
[<img src="https://i.imgur.com/sVEktDn.png">](https://youtu.be/CPLdltN7wgE)
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Undo/Redo in lazygit
|
||||
|
||||
![Gif](../../assets/undo2.gif)
|
||||
You can undo the last action by pressing 'z' and redo with `ctrl+z`. Here we drop a couple of commits and then undo the actions.
|
||||
Undo uses the reflog which is specific to commits and branches so we can't undo changes to the working tree or stash.
|
||||
|
||||
## Keybindings:
|
||||
'z' to undo, 'ctrl+z' to redo
|
||||
![undo](../../assets/demo/undo-compressed.gif)
|
||||
|
||||
## How it works
|
||||
|
||||
|
@ -5,8 +5,6 @@ import (
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
// TODO: fix confirmation view wrapping issue: https://github.com/jesseduffield/lazygit/issues/2872
|
||||
|
||||
var Undo = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Undo",
|
||||
ExtraCmdArgs: []string{},
|
||||
@ -38,14 +36,6 @@ var Undo = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Confirm()
|
||||
}
|
||||
|
||||
confirmRedo := func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Redo")).
|
||||
Content(MatchesRegexp(`Are you sure you want to hard reset to '.*'\? An auto-stash will be performed if necessary\.`)).
|
||||
Wait(500).
|
||||
Confirm()
|
||||
}
|
||||
|
||||
t.Views().Commits().Focus().
|
||||
SetCaptionPrefix("Drop two commits").
|
||||
Wait(1000).
|
||||
@ -58,12 +48,6 @@ var Undo = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Press(keys.Universal.Undo).
|
||||
Tap(confirmUndo).
|
||||
Press(keys.Universal.Undo).
|
||||
Tap(confirmUndo).
|
||||
SetCaptionPrefix("Redo the drops").
|
||||
Wait(1000).
|
||||
Press(keys.Universal.Redo).
|
||||
Tap(confirmRedo).
|
||||
Press(keys.Universal.Redo).
|
||||
Tap(confirmRedo)
|
||||
Tap(confirmUndo)
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user