Documentation ¶
Overview ¶
Package dialog provides high-level screens through which the user can enter data into Git Town.
Index ¶
- Constants
- Variables
- func Aliases(allAliasableCommands configdomain.AliasableCommands, ...) (configdomain.Aliases, bool, error)
- func DetermineAliasResult(selections []AliasSelection, ...) configdomain.Aliases
- func DetermineAliasSelectionText(selectedCommands configdomain.AliasableCommands) string
- func GitHubToken(oldValue configdomain.GitHubToken, inputs components.TestInput) (configdomain.GitHubToken, bool, error)
- func GitLabToken(oldValue configdomain.GitLabToken, inputs components.TestInput) (configdomain.GitLabToken, bool, error)
- func GiteaToken(oldValue configdomain.GiteaToken, inputs components.TestInput) (configdomain.GiteaToken, bool, error)
- func HostingPlatform(existingValue configdomain.HostingPlatform, inputs components.TestInput) (configdomain.HostingPlatform, bool, error)
- func MainBranch(localBranches gitdomain.LocalBranchNames, ...) (gitdomain.LocalBranchName, bool, error)
- func OriginHostname(oldValue configdomain.HostingOriginHostname, inputs components.TestInput) (configdomain.HostingOriginHostname, bool, error)
- func ParentCandidateNames(args ParentArgs) gitdomain.LocalBranchNames
- func PerennialBranches(localBranches gitdomain.LocalBranchNames, ...) (gitdomain.LocalBranchNames, bool, error)
- func PerennialRegex(oldValue configdomain.PerennialRegex, inputs components.TestInput) (configdomain.PerennialRegex, bool, error)
- func PushHook(existing configdomain.PushHook, inputs components.TestInput) (configdomain.PushHook, bool, error)
- func PushNewBranches(existing configdomain.PushNewBranches, inputs components.TestInput) (configdomain.PushNewBranches, bool, error)
- func SelectSquashCommitAuthor(branch gitdomain.LocalBranchName, authors []gitdomain.Author, ...) (gitdomain.Author, bool, error)
- func ShipDeleteTrackingBranch(existing configdomain.ShipDeleteTrackingBranch, inputs components.TestInput) (configdomain.ShipDeleteTrackingBranch, bool, error)
- func SwitchBranch(localBranches gitdomain.LocalBranchNames, ...) (gitdomain.LocalBranchName, bool, error)
- func SwitchBranchCursorPos(entries []SwitchBranchEntry, initialBranch gitdomain.LocalBranchName) int
- func SyncBeforeShip(existing configdomain.SyncBeforeShip, inputs components.TestInput) (configdomain.SyncBeforeShip, bool, error)
- func SyncFeatureStrategy(existing configdomain.SyncFeatureStrategy, inputs components.TestInput) (configdomain.SyncFeatureStrategy, bool, error)
- func SyncPerennialStrategy(existing configdomain.SyncPerennialStrategy, inputs components.TestInput) (configdomain.SyncPerennialStrategy, bool, error)
- func SyncUpstream(existing configdomain.SyncUpstream, inputs components.TestInput) (configdomain.SyncUpstream, bool, error)
- func Welcome(inputs components.TestInput) (bool, error)
- type AliasSelection
- type AliasesModel
- func (self AliasesModel) Checked() configdomain.AliasableCommands
- func (self AliasesModel) Init() tea.Cmd
- func (self *AliasesModel) RotateCurrentEntry()
- func (self *AliasesModel) SelectAll()
- func (self *AliasesModel) SelectNone()
- func (self AliasesModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (self AliasesModel) View() string
- type ConfigStorageOption
- type ParentArgs
- type ParentOutcome
- type PerennialBranchesModel
- func (self *PerennialBranchesModel) CheckedEntries() gitdomain.LocalBranchNames
- func (self *PerennialBranchesModel) DisableCurrentEntry()
- func (self *PerennialBranchesModel) EnableCurrentEntry()
- func (self PerennialBranchesModel) Init() tea.Cmd
- func (self *PerennialBranchesModel) IsRowChecked(row int) bool
- func (self *PerennialBranchesModel) IsSelectedRowChecked() bool
- func (self *PerennialBranchesModel) ToggleCurrentEntry()
- func (self PerennialBranchesModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (self PerennialBranchesModel) View() string
- type Response
- type SwitchBranchEntry
- type SwitchModel
Constants ¶
const ( PushNewBranchesEntryYes pushNewBranchesEntry = "yes, push new branches to origin" PushNewBranchesEntryNo pushNewBranchesEntry = "no, new branches remain local until synced" )
const ( ShipDeleteTrackingBranchEntryYes shipDeleteTrackingBranchEntry = `yes, "git ship" should delete tracking branches` ShipDeleteTrackingBranchEntryNo shipDeleteTrackingBranchEntry = `no, my code hosting platform deletes tracking branches` )
const ( SyncBeforeShipEntryYes syncBeforeShipEntry = `yes, "git ship" should also sync the branch` SyncBeforeShipEntryNo syncBeforeShipEntry = `no, "git ship" should not sync the branch` )
const ( SyncPerennialStrategyEntryMerge syncPerennialStrategyEntry = `merge updates from the tracking branch into perennial branches` SyncPerennialStrategyEntryRebase syncPerennialStrategyEntry = `rebase perennial branches against their tracking branch` )
const ( SyncUpstreamEntryYes syncUpstreamEntry = `yes, receive updates from the upstream repo` SyncUpstreamEntryNo syncUpstreamEntry = `no, don't receive updates from upstream` )
const ( ResponseContinue = Response("continue") // continue the unfinished run state ResponseDiscard = Response("discard") // discard the unfinished run state ResponseQuit = Response("quit") // quit the program ResponseSkip = Response("skip") // continue the unfinished run state by skipping the current branch ResponseUndo = Response("undo") // undo the unfinished run state )
const (
HostingPlatformHelp = `` /* 225-byte string literal not displayed */
)
const (
MainBranchHelp = `` /* 198-byte string literal not displayed */
)
const (
OriginHostnameHelp = `` /* 143-byte string literal not displayed */
)
const (
PerennialBranchesHelp = `` /* 230-byte string literal not displayed */
)
const (
PerennialRegexHelp = `` /* 137-byte string literal not displayed */
)
const (
PushHookHelp = `` /* 340-byte string literal not displayed */
)
const (
PushNewBranchesHelp = `` /* 380-byte string literal not displayed */
)
const (
ShipDeleteTrackingBranchHelp = `` /* 190-byte string literal not displayed */
)
const (
SyncBeforeShipHelp = `` /* 501-byte string literal not displayed */
)
const (
SyncFeatureStrategyHelp = `` /* 230-byte string literal not displayed */
)
const (
SyncPerennialStrategyHelp = `` /* 195-byte string literal not displayed */
)
const (
SyncUpstreamHelp = `` /* 358-byte string literal not displayed */
)
Variables ¶
var PerennialBranchOption = gitdomain.LocalBranchName("<none> (perennial branch)") //nolint:gochecknoglobals
Functions ¶
func Aliases ¶
func Aliases(allAliasableCommands configdomain.AliasableCommands, existingAliases configdomain.Aliases, inputs components.TestInput) (configdomain.Aliases, bool, error)
Aliases lets the user select which Git Town commands should have shorter aliases. This includes asking the user and updating the respective settings based on the user selection.
func DetermineAliasResult ¶
func DetermineAliasResult(selections []AliasSelection, allAliasableCommands configdomain.AliasableCommands, existingAliases configdomain.Aliases) configdomain.Aliases
func DetermineAliasSelectionText ¶
func DetermineAliasSelectionText(selectedCommands configdomain.AliasableCommands) string
func GitHubToken ¶
func GitHubToken(oldValue configdomain.GitHubToken, inputs components.TestInput) (configdomain.GitHubToken, bool, error)
GitHubToken lets the user enter the GitHub API token.
func GitLabToken ¶
func GitLabToken(oldValue configdomain.GitLabToken, inputs components.TestInput) (configdomain.GitLabToken, bool, error)
GitLabToken lets the user enter the GitHub API token.
func GiteaToken ¶
func GiteaToken(oldValue configdomain.GiteaToken, inputs components.TestInput) (configdomain.GiteaToken, bool, error)
GiteaToken lets the user enter the Gitea API token.
func HostingPlatform ¶
func HostingPlatform(existingValue configdomain.HostingPlatform, inputs components.TestInput) (configdomain.HostingPlatform, bool, error)
func MainBranch ¶
func MainBranch(localBranches gitdomain.LocalBranchNames, defaultEntry gitdomain.LocalBranchName, inputs components.TestInput) (gitdomain.LocalBranchName, bool, error)
MainBranch lets the user select a new main branch for this repo.
func OriginHostname ¶
func OriginHostname(oldValue configdomain.HostingOriginHostname, inputs components.TestInput) (configdomain.HostingOriginHostname, bool, error)
GitHubToken lets the user enter the GitHub API token.
func ParentCandidateNames ¶ added in v14.1.0
func ParentCandidateNames(args ParentArgs) gitdomain.LocalBranchNames
func PerennialBranches ¶
func PerennialBranches(localBranches gitdomain.LocalBranchNames, oldPerennialBranches gitdomain.LocalBranchNames, mainBranch gitdomain.LocalBranchName, inputs components.TestInput) (gitdomain.LocalBranchNames, bool, error)
PerennialBranches lets the user update the perennial branches. This includes asking the user and updating the respective settings based on the user selection.
func PerennialRegex ¶
func PerennialRegex(oldValue configdomain.PerennialRegex, inputs components.TestInput) (configdomain.PerennialRegex, bool, error)
PerennialRegex lets the user enter the GitHub API token.
func PushHook ¶
func PushHook(existing configdomain.PushHook, inputs components.TestInput) (configdomain.PushHook, bool, error)
func PushNewBranches ¶
func PushNewBranches(existing configdomain.PushNewBranches, inputs components.TestInput) (configdomain.PushNewBranches, bool, error)
func SelectSquashCommitAuthor ¶
func SelectSquashCommitAuthor(branch gitdomain.LocalBranchName, authors []gitdomain.Author, dialogTestInputs components.TestInput) (gitdomain.Author, bool, error)
SelectSquashCommitAuthor allows the user to select an author amongst a given list of authors.
func ShipDeleteTrackingBranch ¶
func ShipDeleteTrackingBranch(existing configdomain.ShipDeleteTrackingBranch, inputs components.TestInput) (configdomain.ShipDeleteTrackingBranch, bool, error)
func SwitchBranch ¶
func SwitchBranch(localBranches gitdomain.LocalBranchNames, initialBranch gitdomain.LocalBranchName, lineage configdomain.Lineage, allBranches gitdomain.BranchInfos, uncommittedChanges bool, inputs components.TestInput) (gitdomain.LocalBranchName, bool, error)
func SwitchBranchCursorPos ¶
func SwitchBranchCursorPos(entries []SwitchBranchEntry, initialBranch gitdomain.LocalBranchName) int
SwitchBranchCursorPos provides the initial cursor position for the "switch branch" components.
func SyncBeforeShip ¶
func SyncBeforeShip(existing configdomain.SyncBeforeShip, inputs components.TestInput) (configdomain.SyncBeforeShip, bool, error)
func SyncFeatureStrategy ¶
func SyncFeatureStrategy(existing configdomain.SyncFeatureStrategy, inputs components.TestInput) (configdomain.SyncFeatureStrategy, bool, error)
func SyncPerennialStrategy ¶
func SyncPerennialStrategy(existing configdomain.SyncPerennialStrategy, inputs components.TestInput) (configdomain.SyncPerennialStrategy, bool, error)
func SyncUpstream ¶
func SyncUpstream(existing configdomain.SyncUpstream, inputs components.TestInput) (configdomain.SyncUpstream, bool, error)
Types ¶
type AliasSelection ¶
type AliasSelection int
AliasSelection encodes the status of a checkbox in the alias components.
const ( AliasSelectionNone AliasSelection = iota // the user chose to not set this alias AliasSelectionGT // the user chose to set this alias to the corresponding Git Town command AliasSelectionOther // the user chose to keep the alias calling an external command )
func NewAliasSelections ¶
func NewAliasSelections(aliasableCommands configdomain.AliasableCommands, existingAliases configdomain.Aliases) []AliasSelection
type AliasesModel ¶
type AliasesModel struct { list.List[configdomain.AliasableCommand] AllAliasableCommands configdomain.AliasableCommands // all Git Town commands that can be aliased CurrentSelections []AliasSelection // the status of the list entries OriginalAliases configdomain.Aliases // the Git Town aliases as they currently exist on disk // contains filtered or unexported fields }
func (AliasesModel) Checked ¶
func (self AliasesModel) Checked() configdomain.AliasableCommands
func (AliasesModel) Init ¶
func (self AliasesModel) Init() tea.Cmd
func (*AliasesModel) RotateCurrentEntry ¶
func (self *AliasesModel) RotateCurrentEntry()
RotateCurrentEntry switches the status of the currently selected list entry to the next status.
func (*AliasesModel) SelectAll ¶
func (self *AliasesModel) SelectAll()
SelectAll checks all entries in the list.
func (*AliasesModel) SelectNone ¶
func (self *AliasesModel) SelectNone()
SelectNone unchecks all entries in the list.
func (AliasesModel) View ¶
func (self AliasesModel) View() string
type ConfigStorageOption ¶
type ConfigStorageOption string
const ( ConfigStorageOptionFile ConfigStorageOption = `configuration file` ConfigStorageOptionGit ConfigStorageOption = `Git metadata` )
func ConfigStorage ¶
func ConfigStorage(hasConfigFile bool, inputs components.TestInput) (ConfigStorageOption, bool, error)
func (ConfigStorageOption) Short ¶
func (self ConfigStorageOption) Short() string
func (ConfigStorageOption) String ¶
func (self ConfigStorageOption) String() string
type ParentArgs ¶
type ParentArgs struct { Branch gitdomain.LocalBranchName DefaultChoice gitdomain.LocalBranchName DialogTestInput components.TestInput Lineage configdomain.Lineage LocalBranches gitdomain.LocalBranchNames MainBranch gitdomain.LocalBranchName }
type ParentOutcome ¶ added in v14.2.0
type ParentOutcome int
ParentOutcome describes the selection that the user made in the `Parent` dialog.
const ( ParentOutcomeAborted ParentOutcome = iota // the user aborted the dialog ParentOutcomePerennialBranch // the user chose the "perennial branch" option ParentOutcomeSelectedParent // the user selected one of the branches )
func Parent ¶
func Parent(args ParentArgs) (ParentOutcome, gitdomain.LocalBranchName, error)
Parent lets the user select the parent branch for the given branch.
type PerennialBranchesModel ¶
type PerennialBranchesModel struct { list.List[gitdomain.LocalBranchName] Selections []int // contains filtered or unexported fields }
func (*PerennialBranchesModel) CheckedEntries ¶
func (self *PerennialBranchesModel) CheckedEntries() gitdomain.LocalBranchNames
checkedEntries provides all checked list entries.
func (*PerennialBranchesModel) DisableCurrentEntry ¶
func (self *PerennialBranchesModel) DisableCurrentEntry()
disableCurrentEntry unchecks the currently selected list entry.
func (*PerennialBranchesModel) EnableCurrentEntry ¶
func (self *PerennialBranchesModel) EnableCurrentEntry()
enableCurrentEntry checks the currently selected list entry.
func (PerennialBranchesModel) Init ¶
func (self PerennialBranchesModel) Init() tea.Cmd
func (*PerennialBranchesModel) IsRowChecked ¶
func (self *PerennialBranchesModel) IsRowChecked(row int) bool
isRowChecked indicates whether the row with the given number is checked or not.
func (*PerennialBranchesModel) IsSelectedRowChecked ¶
func (self *PerennialBranchesModel) IsSelectedRowChecked() bool
isSelectedRowChecked indicates whether the currently selected list entry is checked or not.
func (*PerennialBranchesModel) ToggleCurrentEntry ¶
func (self *PerennialBranchesModel) ToggleCurrentEntry()
toggleCurrentEntry unchecks the currently selected list entry if it is checked, and checks it if it is unchecked.
func (PerennialBranchesModel) View ¶
func (self PerennialBranchesModel) View() string
type Response ¶
type Response string
func AskHowToHandleUnfinishedRunState ¶
func AskHowToHandleUnfinishedRunState(command string, endBranch gitdomain.LocalBranchName, endTime time.Time, canSkip bool, dialogTestInput components.TestInput) (Response, bool, error)
AskHowToHandleUnfinishedRunState prompts the user for how to handle the unfinished run state.
type SwitchBranchEntry ¶
type SwitchBranchEntry struct { Branch gitdomain.LocalBranchName Indentation string OtherWorktree bool }
func SwitchBranchEntries ¶
func SwitchBranchEntries(localBranches gitdomain.LocalBranchNames, lineage configdomain.Lineage, allBranches gitdomain.BranchInfos) []SwitchBranchEntry
SwitchBranchEntries provides the entries for the "switch branch" components.
func (SwitchBranchEntry) String ¶
func (sbe SwitchBranchEntry) String() string
type SwitchModel ¶
type SwitchModel struct { list.List[SwitchBranchEntry] InitialBranchPos int // position of the currently checked out branch in the list UncommittedChanges bool // whether the workspace has uncommitted changes }
func (SwitchModel) Init ¶
func (self SwitchModel) Init() tea.Cmd
func (SwitchModel) View ¶
func (self SwitchModel) View() string
Source Files ¶
- aliases.go
- config_storage.go
- core.go
- gitea_token.go
- github_token.go
- gitlab_token.go
- hosting.go
- main_branch.go
- origin_hostname.go
- parent.go
- perennial_branches.go
- perennial_regex.go
- push_hook.go
- push_new_branches.go
- select_squash_commit_author.go
- ship_delete_tracking_branch.go
- switch_branch.go
- sync_before_ship.go
- sync_feature_strategy.go
- sync_perennial_strategy.go
- sync_upstream.go
- unfinished_run_state.go
- welcome.go
Directories ¶
Path | Synopsis |
---|---|
Package dialog contains shared components to build full dialog screens out of.
|
Package dialog contains shared components to build full dialog screens out of. |
list
Package list provides a generic list implementation to be used inside BubbleTea-based dialog components.
|
Package list provides a generic list implementation to be used inside BubbleTea-based dialog components. |