Klasse MailMap
java.lang.Object
com.github.koraktor.mavanagaiata.git.MailMap
An implementation of Git's
.mailmap
functionality- Autor:
- Sebastian Staudt
-
Feldübersicht
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
exists()
Returns whether a mail map has been found for the repositoryReturns the canonical email address of the author of the given commit objectgetCanonicalAuthorName
(GitCommit commit) Returns the canonical name of the author of the given commit objectReturns the canonical email address of the committer of the given commit objectgetCanonicalCommitterName
(GitCommit commit) Returns the canonical name of the committer of the given commit object(Package privat) String
getCanonicalMail
(String name, String mail) Returns the canonical email address for the given name and email address pair(Package privat) String
getCanonicalName
(String name, String mail) Returns the canonical name for the given name and email address pair(Package privat) void
Tries to parse the.mailmap
file from the worktree of the given repository.(Package privat) void
parseMailMap
(File mailMap) Tries to parse the given file using the rules from git-shortlog.
-
Felddetails
-
MAILMAP_FILE
- Siehe auch:
-
MAIL_TO_MAIL_PATTERN
-
MAIL_TO_NAME_PATTERN
-
MAIL_TO_NAME_AND_MAIL_PATTERN
-
NAME_AND_MAIL_TO_NAME_AND_MAIL_PATTERN
-
exists
boolean exists -
mailToMailMap
-
mailToNameMap
-
mailToNameAndMailMap
-
nameAndMailToNameAndMailMap
-
repository
GitRepository repository
-
-
Konstruktordetails
-
MailMap
MailMap(GitRepository repository) Creates a new mail map instance- Parameter:
repository
- The Git repository to parse the mail map for- Siehe auch:
-
-
Methodendetails
-
exists
public boolean exists()Returns whether a mail map has been found for the repository- Gibt zurück:
true
if the mail map has been parsed from an existing.mailmap
file- Siehe auch:
-
getCanonicalMail
Returns the canonical email address for the given name and email address pair- Parameter:
name
- The actual name from a commitmail
- The actual email address from a commit- Gibt zurück:
- The email address matching a mapping in the mail map or the initial email address
-
getCanonicalName
Returns the canonical name for the given name and email address pair- Parameter:
name
- The actual name from a commitmail
- The actual email address from a commit- Gibt zurück:
- The name matching a mapping in the mail map or the initial name
-
getCanonicalAuthorEmailAddress
Returns the canonical email address of the author of the given commit object- Parameter:
commit
- The commit object to get the email address from- Gibt zurück:
- The canonical email address of the author
- Siehe auch:
-
getCanonicalAuthorName
Returns the canonical name of the author of the given commit object- Parameter:
commit
- The commit object to get the name from- Gibt zurück:
- The canonical name of the author
- Siehe auch:
-
getCanonicalCommitterEmailAddress
Returns the canonical email address of the committer of the given commit object- Parameter:
commit
- The commit object to get the email address from- Gibt zurück:
- The canonical email address of the author
- Siehe auch:
-
getCanonicalCommitterName
Returns the canonical name of the committer of the given commit object- Parameter:
commit
- The commit object to get the name from- Gibt zurück:
- The canonical name of the author
- Siehe auch:
-
parseMailMap
Tries to parse the.mailmap
file from the worktree of the given repository.
If the file exists and contains valid contentexists()
will returntrue
.- Löst aus:
GitRepositoryException
- if the.mailmap
file cannot be read- Siehe auch:
-
parseMailMap
Tries to parse the given file using the rules from git-shortlog.
Lines not matching one of the valid formats are silently ignored.- Parameter:
mailMap
- The.mailmap
file to parse- Löst aus:
FileNotFoundException
- if the.mailmap
file does not existIOException
- if the.mailmap
file cannot be read
-