Repository: jesseduffield/lazygit
File: pkg/gui/controllers/workspace_reset_controller.go (Go)

Code before:

				return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
			},
			Key: 'u',
		},
		{
			LabelColumns: []string{
				self.c.Tr.LcDiscardUntrackedFiles,
				red.Sprint("git clean -fd"),
			},
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RemoveUntrackedFiles)
				if err := self.git.WorkingTree.RemoveUntrackedFiles(); err != nil {
					return self.c.Error(err)
				}

				return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
			},
			Key: 'c',
		},
		{
			LabelColumns: []string{
				self.c.Tr.LcDiscardStagedChanges,
				red.Sprint("stash staged and drop stash"),
			},
			Tooltip: "This will create a new stash entry containing only staged files and then drop it.",
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RemoveStagedFiles)
				if !self.helpers.WorkingTree.IsWorkingTreeDirty() {
					return self.c.ErrorMsg(self.c.Tr.NoTrackedStagedFilesStash)
				}
				if err := self.git.Stash.SaveStagedChanges("[lazygit] tmp stash"); err != nil {
					return self.c.Error(err)
				}
				if err := self.git.Stash.DropNewest(); err != nil {
					return self.c.Error(err)
				}

				return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
			},
			Key: 'S',
		},
		{
			LabelColumns: []string{
				self.c.Tr.LcSoftReset,
				red.Sprint("git reset --soft HEAD"),
			},
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.SoftReset)
				if err := self.git.WorkingTree.ResetSoft("HEAD"); err != nil {
					return self.c.Error(err)

Review comment (suggestion):
```suggestion
			Tooltip: "This will create a new stash entry containing only staged files and then drop it, so that the working tree is left with only unstaged changes",
```
We'll want to i18n-ise this

Code after:

				return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
			},
			Key: 'u',
		},
		{
			LabelColumns: []string{
				self.c.Tr.LcDiscardUntrackedFiles,
				red.Sprint("git clean -fd"),
			},
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RemoveUntrackedFiles)
				if err := self.git.WorkingTree.RemoveUntrackedFiles(); err != nil {
					return self.c.Error(err)
				}

				return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
			},
			Key: 'c',
		},
		{
			LabelColumns: []string{
				self.c.Tr.LcDiscardStagedChanges,
				red.Sprint("stash staged and drop stash"),
			},
			Tooltip: self.c.Tr.DiscardStagedChangesDescription,
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RemoveStagedFiles)
				if !self.helpers.WorkingTree.IsWorkingTreeDirty() {
					return self.c.ErrorMsg(self.c.Tr.NoTrackedStagedFilesStash)
				}
				if err := self.git.Stash.SaveStagedChanges("[lazygit] tmp stash"); err != nil {
					return self.c.Error(err)
				}
				if err := self.git.Stash.DropNewest(); err != nil {
					return self.c.Error(err)
				}

				return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
			},
			Key: 'S',
		},
		{
			LabelColumns: []string{
				self.c.Tr.LcSoftReset,
				red.Sprint("git reset --soft HEAD"),
			},
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.SoftReset)
				if err := self.git.WorkingTree.ResetSoft("HEAD"); err != nil {
					return self.c.Error(err)