Class AppSettings

java.lang.Object
io.github.jbastgen.stemma.app.config.AppSettings

public final class AppSettings extends Object
The global settings that the settings dialog edits (everything except look and layout, see ViewSettings). A plain mutable object: the dialog works on a copy() and hands it back on Save.
  • Field Details

    • firstStartDone

      public boolean firstStartDone
      The settings dialog was shown at the first start. Deleting the settings file brings the welcome back.
    • projectDir

      public String projectDir
      Folder that clone / create / open start in; empty = the home folder.
    • reloadOnFocus

      public boolean reloadOnFocus
      Reload the open repository when the window gets the focus again (another tool may have changed it).
    • refreshOnChange

      public boolean refreshOnChange
      Feature 53: refresh the open repository when files change on disk or another tool changes it, not only when the window gets the focus.
    • logLevel

      public String logLevel
      How much is written to the log file: info, debug or trace (see LogLevel).
    • supportLinkEnabled

      public boolean supportLinkEnabled
      Feature 19: the small "Buy me a coffee" link in the status bar and in the About dialog.
    • gravatarEnabled

      public boolean gravatarEnabled
      Feature 59: pictures and profile pages of the authors from Gravatar. Off: a request carries the hash of an author's e-mail address to gravatar.com.
    • syntaxHighlighting

      public boolean syntaxHighlighting
      Feature 52: the Files view shows source files in the colours of their language.
    • githubPicturesEnabled

      public boolean githubPicturesEnabled
      Feature 59: pictures and profile pages of the authors from GitHub (preferred over Gravatar). Off: a request names a commit of the GitHub repository.
    • confirmDiscard

      public boolean confirmDiscard
      Ask before files are discarded or deleted from the commit panel (conflicted files and the toolbar button always ask).
    • discardToTrash

      public boolean discardToTrash
      Move untracked files that are deleted to the operating system's trash, where there is one.
    • fetchPrune

      public boolean fetchPrune
      Fetch removes remote-tracking branches that are gone from the remote (feature 22).
    • autoFetch

      public boolean autoFetch
      Feature 54: fetch from the remotes of the open repositories by itself (off by default).
    • autoFetchMinutes

      public int autoFetchMinutes
      Minutes between two automatic fetches of a repository.
    • autoFetchInBackground

      public boolean autoFetchInBackground
      Also fetch while the window is in the background (by default only while it is the active window).
    • confirmAmendPublished

      public boolean confirmAmendPublished
      Ask before amending a commit that is already on the upstream branch (it will need a force push).
    • confirmReset

      public boolean confirmReset
      Feature 45: ask once more before a hard reset throws changes away (the dialog that picks the kind of reset always appears).
    • resetBackup

      public boolean resetBackup
      Feature 45: before a hard reset keep the working tree and the old branch tip under refs/stemma/reset/….
    • offerForcePush

      public boolean offerForcePush
      Offer "Force push (with lease)" after a rejected push and in the menu of the Push button.
    • allowPlainForce

      public boolean allowPlainForce
      Also offer a plain force push (without the lease that protects other people's work).
    • pushTagsWithBranch

      public boolean pushTagsWithBranch
      Push the tags together with a branch that is pushed.
    • ignoreTarget

      public String ignoreTarget
      Where "Ignore" from the menu of a file writes to: gitignore (shared) or exclude (only this clone).
    • backend

      public BackendSettings backend
    • gitUserName

      public String gitUserName
      Author for commits when neither the repository nor the user's git configuration names one.
    • gitUserEmail

      public String gitUserEmail
    • gitExtraConfig

      public String gitExtraConfig
      Further git configuration, one section.name=value per line.
    • commitTemplate

      public String commitTemplate
      Template for new commit messages, see MessageTemplates; empty = none.
    • mergeTemplate

      public String mergeTemplate
      Template for the message of a merge commit; empty = git's own message.
    • prefillCommit

      public boolean prefillCommit
      Fill the commit form with the template when it is empty.
    • labelsEnabled

      public boolean labelsEnabled
      Commit labels (feature, bugfix, …) on or off.
    • labelsIndexFile

      public String labelsIndexFile
      The label index file; empty = labels.tsv in the configuration folder. Point it at a shared folder to share labels.
    • language

      public String language
      Feature 9: the language of the interface: a code of i18n/languages.tsv, or empty for the language of the system.
    • usersEnabled

      public boolean usersEnabled
      Feature 26: show several identities of one person as one user, as the user mapping file says.
    • usersFile

      public String usersFile
      The user mapping file; empty = users.tsv in the configuration folder.
    • fileManagerEnabled

      public boolean fileManagerEnabled
      Feature 10: the "Show in Explorer / Finder / Files" button and the "Show in file manager" entry of a file.
    • fileManagerCommand

      public String fileManagerCommand
      Command line that replaces the platform's way; $DIR and $FILE are replaced. Empty = the platform's way.
    • tools

      public String tools
      Feature 13: programs for the entry "Open in …" of a file, one per line (see ExternalTools).
    • remoteLinksEnabled

      public boolean remoteLinksEnabled
      Feature 14: the entries that open the commit, branch, file or repository on the hosting service of the remote.
    • remoteHosts

      public String remoteHosts
      Servers of your own: one host = service per line (github, gitlab, bitbucket, azure, gitea).
    • openFileEnabled

      public boolean openFileEnabled
      Feature 12: the entry "Open" in the menu of a file (opens it with the system's program).
    • terminalEnabled

      public boolean terminalEnabled
      Feature 11: the "Terminal" toolbar button that opens a terminal in the repository.
    • terminalProgram

      public String terminalProgram
      Which terminal: auto (the first one installed) or the key of one (see TerminalLauncher.Terminal).
    • terminalCommand

      public String terminalCommand
      Command line that replaces the choice above; $DIR is the repository's folder. Empty = use the choice.
    • aiEnabled

      public boolean aiEnabled
    • aiSummaryEnabled

      public boolean aiSummaryEnabled
      Feature 3: describe the selected commits with AI. Only has an effect while aiEnabled is on.
    • aiMessagesEnabled

      public boolean aiMessagesEnabled
      Feature 4: suggest messages for staged changes. Only has an effect while aiEnabled is on.
    • aiLabelsEnabled

      public boolean aiLabelsEnabled
      Estimate the labels of commits with AI (context menu of commits). Only has an effect while aiEnabled is on.
    • aiTranslateEnabled

      public boolean aiTranslateEnabled
      Feature 7: translate commit messages with the AI.
    • translateSkipLanguages

      public String translateSkipLanguages
      Feature 7: languages whose messages are not translated (names separated by commas): by default English and the language of the interface.
    • commitMessageLanguage

      public String commitMessageLanguage
      Language of the commit, merge and tag messages the AI suggests (English name); empty = the language of the recent commit messages.
    • aiChangelogEnabled

      public boolean aiChangelogEnabled
      Feature 5: write changelog entries with the AI.
    • aiCoworkEnabled

      public boolean aiCoworkEnabled
      The tab "Cowork" of a repository: talk to the AI about it. Only has an effect while aiEnabled is on and the connection is set up.
    • aiMergeEnabled

      public boolean aiMergeEnabled
      Feature 6: propose the resolution of merge conflicts with the AI.
    • translateLanguage

      public String translateLanguage
      The language last chosen for translating commit messages (English name).
    • labelHintsEnabled

      public boolean labelHintsEnabled
      Feature 25/28: propose labels in the commit form from the branch name and the files, without AI (the rules of LabelHints).
    • aiLabelPreselect

      public boolean aiLabelPreselect
      Feature 28: ask the AI for labels by itself while files are selected for the commit (sends file names without a click).
    • aiLogEnabled

      public boolean aiLogEnabled
      Write everything that is sent to an AI service to the AI log file (see AiLog).
    • aiProvider

      public AiProviderKind aiProvider
    • aiEndpoint

      public String aiEndpoint
    • aiModel

      public String aiModel
    • aiAccountId

      public String aiAccountId
      The account (Settings → Accounts) holding the API key.
    • aiMaxPromptChars

      public int aiMaxPromptChars
    • aiMaxTokens

      public int aiMaxTokens
    • aiTimeoutSeconds

      public int aiTimeoutSeconds
    • aiRetries

      public int aiRetries
    • aiLocalOnly

      public boolean aiLocalOnly
    • aiExcludePatterns

      public String aiExcludePatterns
    • aiRedactSecrets

      public boolean aiRedactSecrets
    • aiToolCommand

      public String aiToolCommand
    • aiToolWorkDir

      public String aiToolWorkDir
      Working folder of the local AI tool; empty (the default), . or ./ = the repository the request is about.
    • aiCopilotCommand

      public String aiCopilotCommand
      Command line of the GitHub Copilot command line tool; $PROMPT is the prompt.
    • aiCustomHeaders

      public String aiCustomHeaders
    • aiCustomBody

      public String aiCustomBody
    • aiCustomAnswerPath

      public String aiCustomAnswerPath
    • mergeTool

      public AppSettings.MergeToolMode mergeTool
    • externalMergeCommand

      public String externalMergeCommand
      Command line of the external merge tool; $BASE $LOCAL $REMOTE $MERGED are replaced.
    • proxyMode

      public io.github.jbastgen.stemma.git.api.GitOptions.ProxyMode proxyMode
    • proxyUrl

      public String proxyUrl
    • noProxy

      public String noProxy
    • verifySsl

      public boolean verifySsl
    • caBundle

      public String caBundle
    • acceptNewSshHosts

      public boolean acceptNewSshHosts
  • Constructor Details

    • AppSettings

      public AppSettings()
  • Method Details

    • copy

      public AppSettings copy()
      A copy to edit; the settings dialog works on a copy and the application takes it over on OK.
    • toGitOptions

      public io.github.jbastgen.stemma.git.api.GitOptions toGitOptions()
      The part of the settings the Git backends need. Lines that are not valid configuration are skipped.
    • toGitOptions

      public io.github.jbastgen.stemma.git.api.GitOptions toGitOptions(io.github.jbastgen.stemma.git.api.CredentialLookup credentials, Path askpass, Path sshDirectory)
      As toGitOptions(), plus where credentials come from and where the built-in Git keeps SSH host keys.
    • toAiConfig

      public AiConfig toAiConfig()
      The AI settings as the connection uses them; numbers are kept within sensible limits.
    • parseExtraConfig

      public static AppSettings.ParsedConfig parseExtraConfig(String text)
      Reads key=value lines; blank lines and lines starting with # are ignored.