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

Code before:
	case enums.REBASE_MODE_NONE:
		return ""
	case enums.REBASE_MODE_MERGING:
		return "merge"
	default:
		return "rebase"
	}
}

// PromptToContinueRebase asks the user if they want to continue the rebase/merge that's in progress
func (self *MergeAndRebaseHelper) PromptToContinueRebase() error {
	return self.c.Confirm(types.ConfirmOpts{
		Title:  "continue",
		Prompt: self.c.Tr.ConflictsResolved,
		HandleConfirm: func() error {
			return self.genericMergeCommand(REBASE_OPTION_CONTINUE)
		},
	})
}

func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
	checkedOutBranch := self.refsHelper.GetCheckedOutRef().Name
	if ref == checkedOutBranch {
		return self.c.ErrorMsg(self.c.Tr.CantRebaseOntoSelf)
	}
	menuItems := []*types.MenuItem{
		{
			Label: self.c.Tr.SimpleInteractiveRebase,
			Key:   's',
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RebaseBranch)
				err := self.git.Rebase.RebaseBranch(ref)
				return self.CheckMergeOrRebase(err)
			},
		},
		{
			Label: self.c.Tr.InteractiveRebaseWithTodoEdit,
			Key:   'e',
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RebaseBranch)
				err := self.git.Rebase.EditRebase(ref)
				return self.CheckMergeOrRebase(err)
			},
		},
	}

	return self.c.Menu(types.CreateMenuOptions{
		Title: self.c.Tr.SelectRebaseKind,
		Items: menuItems,
	})
}

Review comment (suggestion):
We still want to tell the user that we're rebasing from `checkedOutBranch` to `ref`. So I'm thinking:
```
Title: Rebase '{{checkedOutBranch}}' onto '{{ref}}'
Item 1: s: Simple rebase
Item 2: i: Interactive rebase
```

And I'd add a tooltip for item 2 saying 'Begin an interactive rebase with a break at the start, so you can update the TODO commits before continuing'

Code after:
	case enums.REBASE_MODE_NONE:
		return ""
	case enums.REBASE_MODE_MERGING:
		return "merge"
	default:
		return "rebase"
	}
}

// PromptToContinueRebase asks the user if they want to continue the rebase/merge that's in progress
func (self *MergeAndRebaseHelper) PromptToContinueRebase() error {
	return self.c.Confirm(types.ConfirmOpts{
		Title:  "continue",
		Prompt: self.c.Tr.ConflictsResolved,
		HandleConfirm: func() error {
			return self.genericMergeCommand(REBASE_OPTION_CONTINUE)
		},
	})
}

func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
	checkedOutBranch := self.refsHelper.GetCheckedOutRef().Name
	if ref == checkedOutBranch {
		return self.c.ErrorMsg(self.c.Tr.CantRebaseOntoSelf)
	}
	menuItems := []*types.MenuItem{
		{
			Label: self.c.Tr.SimpleRebase,
			Key:   's',
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RebaseBranch)
				err := self.git.Rebase.RebaseBranch(ref)
				return self.CheckMergeOrRebase(err)
			},
		},
		{
			Label:   self.c.Tr.InteractiveRebase,
			Key:     'i',
			Tooltip: self.c.Tr.InteractiveRebaseTooltip,
			OnPress: func() error {
				self.c.LogAction(self.c.Tr.Actions.RebaseBranch)
				err := self.git.Rebase.EditRebase(ref)
				if err = self.CheckMergeOrRebase(err); err != nil {
					return err
				}
				return self.c.PushContext(self.contexts.LocalCommits)
			},
		},
	}

	title := utils.ResolvePlaceholderString(