Record Class GitOptions
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.GitOptions
- Record Components:
defaultIdentity- author and committer to use when neither the repository nor the user's git configuration names one;nullfor none. A configured identity always wins.extraConfig- further git configuration (section.name→ value) that is in effect for every command, with the precedence ofgit -c: it overrides the configuration filesnetwork- proxy, certificate and SSH host-key handlingcredentials- where stored credentials come from;nullfor noneaskpass- a script that prints$STEMMA_GIT_USERNAMEfor a "Username …" prompt and$STEMMA_GIT_PASSWORDfor any other; system git uses it to pass credentials without putting them on a command line.nullif there is none.sshDirectory- where the built-in Git keeps itsknown_hosts;null= the user's~/.ssh
public record GitOptions(GitOptions.Identity defaultIdentity, Map<String,String> extraConfig, GitOptions.Network network, CredentialLookup credentials, Path askpass, Path sshDirectory)
extends Record
Settings the application hands to a Git backend. They belong to Stemma, not to git: they are applied per command
and never written to
~/.gitconfig or to a repository's .git/config (ADR 0007).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordChanges to the environment of a git process.static final recordName and e-mail of the person making commits.static final recordNetwork settings.static enumHow the proxy of a network operation is chosen. -
Constructor Summary
ConstructorsConstructorDescriptionGitOptions(GitOptions.Identity defaultIdentity, Map<String, String> extraConfig, GitOptions.Network network) Options without credentials, askpass script or SSH folder.GitOptions(GitOptions.Identity defaultIdentity, Map<String, String> extraConfig, GitOptions.Network network, CredentialLookup credentials, Path askpass, Path sshDirectory) Creates an instance of aGitOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaskpass()Returns the value of theaskpassrecord component.credentialFor(String accountId, String url) The credential for a remote, if the application has one.Returns the value of thecredentialsrecord component.Returns the value of thedefaultIdentityrecord component.Everything that is in effect as git configuration: the extra configuration plus what the network settings mean as configuration (http.proxy,http.sslVerify,http.sslCAInfo).What to change in the environment of a git process: proxy variables and, if wanted, the SSH command.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theextraConfigrecord component.final inthashCode()Returns a hash code value for this object.static booleanisValidKey(String key) Whetherkeylooks likesection.nameorsection.subsection.name.network()Returns the value of thenetworkrecord component.static GitOptionsnone()Options that change nothing: no identity, no extra configuration, default network settings.Returns the value of thesshDirectoryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GitOptions
public GitOptions(GitOptions.Identity defaultIdentity, Map<String, String> extraConfig, GitOptions.Network network) Options without credentials, askpass script or SSH folder. -
GitOptions
public GitOptions(GitOptions.Identity defaultIdentity, Map<String, String> extraConfig, GitOptions.Network network, CredentialLookup credentials, Path askpass, Path sshDirectory) Creates an instance of aGitOptionsrecord class.- Parameters:
defaultIdentity- the value for thedefaultIdentityrecord componentextraConfig- the value for theextraConfigrecord componentnetwork- the value for thenetworkrecord componentcredentials- the value for thecredentialsrecord componentaskpass- the value for theaskpassrecord componentsshDirectory- the value for thesshDirectoryrecord component
-
-
Method Details
-
none
Options that change nothing: no identity, no extra configuration, default network settings. -
credentialFor
The credential for a remote, if the application has one. -
isValidKey
Whetherkeylooks likesection.nameorsection.subsection.name. -
effectiveConfig
Everything that is in effect as git configuration: the extra configuration plus what the network settings mean as configuration (http.proxy,http.sslVerify,http.sslCAInfo). The network settings win. -
environment
What to change in the environment of a git process: proxy variables and, if wanted, the SSH command. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
defaultIdentity
Returns the value of thedefaultIdentityrecord component.- Returns:
- the value of the
defaultIdentityrecord component
-
extraConfig
Returns the value of theextraConfigrecord component.- Returns:
- the value of the
extraConfigrecord component
-
network
Returns the value of thenetworkrecord component.- Returns:
- the value of the
networkrecord component
-
credentials
Returns the value of thecredentialsrecord component.- Returns:
- the value of the
credentialsrecord component
-
askpass
Returns the value of theaskpassrecord component.- Returns:
- the value of the
askpassrecord component
-
sshDirectory
Returns the value of thesshDirectoryrecord component.- Returns:
- the value of the
sshDirectoryrecord component
-