1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-27 22:38:09 +02:00

Use abbreviated hash in undo confirmations

This commit is contained in:
Stefan Haller
2025-07-03 16:31:40 +02:00
parent 50785a2217
commit 2c206c374d

View File

@@ -90,7 +90,7 @@ func (self *UndoController) reflogUndo() error {
case COMMIT: case COMMIT:
self.c.Confirm(types.ConfirmOpts{ self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Undo, Title: self.c.Tr.Actions.Undo,
Prompt: fmt.Sprintf(self.c.Tr.SoftResetPrompt, action.from), Prompt: fmt.Sprintf(self.c.Tr.SoftResetPrompt, utils.ShortHash(action.from)),
HandleConfirm: func() error { HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.Undo) self.c.LogAction(self.c.Tr.Actions.Undo)
return self.c.WithWaitingStatus(undoingStatus, func(gocui.Task) error { return self.c.WithWaitingStatus(undoingStatus, func(gocui.Task) error {
@@ -103,7 +103,7 @@ func (self *UndoController) reflogUndo() error {
case REBASE: case REBASE:
self.c.Confirm(types.ConfirmOpts{ self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Undo, Title: self.c.Tr.Actions.Undo,
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, action.from), Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, utils.ShortHash(action.from)),
HandleConfirm: func() error { HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.Undo) self.c.LogAction(self.c.Tr.Actions.Undo)
return self.hardResetWithAutoStash(action.from, hardResetOptions{ return self.hardResetWithAutoStash(action.from, hardResetOptions{
@@ -157,7 +157,7 @@ func (self *UndoController) reflogRedo() error {
case COMMIT, REBASE: case COMMIT, REBASE:
self.c.Confirm(types.ConfirmOpts{ self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Redo, Title: self.c.Tr.Actions.Redo,
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, action.to), Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, utils.ShortHash(action.to)),
HandleConfirm: func() error { HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.Redo) self.c.LogAction(self.c.Tr.Actions.Redo)
return self.hardResetWithAutoStash(action.to, hardResetOptions{ return self.hardResetWithAutoStash(action.to, hardResetOptions{