Package org.eclipse.jgit.lib
Class UserConfig
- java.lang.Object
-
- org.eclipse.jgit.lib.UserConfig
-
public class UserConfig extends java.lang.Object
The standard "user" configuration parameters.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
authorEmail
private java.lang.String
authorName
private java.lang.String
committerEmail
private java.lang.String
committerName
private boolean
isAuthorEmailImplicit
private boolean
isAuthorNameImplicit
private boolean
isCommitterEmailImplicit
private boolean
isCommitterNameImplicit
static Config.SectionParser<UserConfig>
KEY
Key forConfig.get(SectionParser)
.
-
Constructor Summary
Constructors Modifier Constructor Description private
UserConfig(Config rc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAuthorEmail()
Get the author email as defined in git variables and configurations.java.lang.String
getAuthorName()
Get the author name as defined in the git variables and configurations.java.lang.String
getCommitterEmail()
Get the committer email as defined in git variables and configurations.java.lang.String
getCommitterName()
Get the committer name as defined in the git variables and configurations.private static java.lang.String
getDefaultEmail()
private static java.lang.String
getDefaultUserName()
private static java.lang.String
getEmailInternal(Config rc, java.lang.String envKey)
private static java.lang.String
getNameInternal(Config rc, java.lang.String envKey)
boolean
isAuthorEmailImplicit()
Whether the author email was not explicitly configured but constructed from information the system has about the logged on userboolean
isAuthorNameImplicit()
Whether the author name was not explicitly configured but constructed from information the system has about the logged on userboolean
isCommitterEmailImplicit()
Whether the author email was not explicitly configured but constructed from information the system has about the logged on userboolean
isCommitterNameImplicit()
Whether the committer name was not explicitly configured but constructed from information the system has about the logged on userprivate static java.lang.String
stripInvalidCharacters(java.lang.String s)
private static SystemReader
system()
-
-
-
Field Detail
-
KEY
public static final Config.SectionParser<UserConfig> KEY
Key forConfig.get(SectionParser)
.
-
authorName
private java.lang.String authorName
-
authorEmail
private java.lang.String authorEmail
-
committerName
private java.lang.String committerName
-
committerEmail
private java.lang.String committerEmail
-
isAuthorNameImplicit
private boolean isAuthorNameImplicit
-
isAuthorEmailImplicit
private boolean isAuthorEmailImplicit
-
isCommitterNameImplicit
private boolean isCommitterNameImplicit
-
isCommitterEmailImplicit
private boolean isCommitterEmailImplicit
-
-
Constructor Detail
-
UserConfig
private UserConfig(Config rc)
-
-
Method Detail
-
getAuthorName
public java.lang.String getAuthorName()
Get the author name as defined in the git variables and configurations.- Returns:
- the author name as defined in the git variables and configurations. If no name could be found, try to use the system user name instead.
-
getCommitterName
public java.lang.String getCommitterName()
Get the committer name as defined in the git variables and configurations.- Returns:
- the committer name as defined in the git variables and configurations. If no name could be found, try to use the system user name instead.
-
getAuthorEmail
public java.lang.String getAuthorEmail()
Get the author email as defined in git variables and configurations.- Returns:
- the author email as defined in git variables and configurations. If no email could be found, try to propose one default with the user name and the host name.
-
getCommitterEmail
public java.lang.String getCommitterEmail()
Get the committer email as defined in git variables and configurations.- Returns:
- the committer email as defined in git variables and configurations. If no email could be found, try to propose one default with the user name and the host name.
-
isAuthorNameImplicit
public boolean isAuthorNameImplicit()
Whether the author name was not explicitly configured but constructed from information the system has about the logged on user- Returns:
- true if the author name was not explicitly configured but constructed from information the system has about the logged on user
-
isAuthorEmailImplicit
public boolean isAuthorEmailImplicit()
Whether the author email was not explicitly configured but constructed from information the system has about the logged on user- Returns:
- true if the author email was not explicitly configured but constructed from information the system has about the logged on user
-
isCommitterNameImplicit
public boolean isCommitterNameImplicit()
Whether the committer name was not explicitly configured but constructed from information the system has about the logged on user- Returns:
- true if the committer name was not explicitly configured but constructed from information the system has about the logged on user
-
isCommitterEmailImplicit
public boolean isCommitterEmailImplicit()
Whether the author email was not explicitly configured but constructed from information the system has about the logged on user- Returns:
- true if the author email was not explicitly configured but constructed from information the system has about the logged on user
-
getNameInternal
private static java.lang.String getNameInternal(Config rc, java.lang.String envKey)
-
getDefaultUserName
private static java.lang.String getDefaultUserName()
- Returns:
- try to get user name of the logged on user from the operating system
-
getEmailInternal
private static java.lang.String getEmailInternal(Config rc, java.lang.String envKey)
-
stripInvalidCharacters
private static java.lang.String stripInvalidCharacters(java.lang.String s)
-
getDefaultEmail
private static java.lang.String getDefaultEmail()
- Returns:
- try to construct email for logged on user using system information
-
system
private static SystemReader system()
-
-