diff --git a/README.md b/README.md index c6da3a2e1..0eddae062 100644 --- a/README.md +++ b/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 [](https://youtu.be/CPLdltN7wgE) diff --git a/docs/Undoing.md b/docs/Undoing.md index 7b5a15648..0a4c2f381 100644 --- a/docs/Undoing.md +++ b/docs/Undoing.md @@ -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 diff --git a/pkg/integration/tests/demo/undo.go b/pkg/integration/tests/demo/undo.go index d6dbb0e83..725090ed6 100644 --- a/pkg/integration/tests/demo/undo.go +++ b/pkg/integration/tests/demo/undo.go @@ -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) }, })