Klasse MailMap

java.lang.Object
com.github.koraktor.mavanagaiata.git.MailMap

public class MailMap extends Object
An implementation of Git's .mailmap functionality
Autor:
Sebastian Staudt
  • Felddetails

  • 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

      String getCanonicalMail(String name, String mail)
      Returns the canonical email address for the given name and email address pair
      Parameter:
      name - The actual name from a commit
      mail - 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

      String getCanonicalName(String name, String mail)
      Returns the canonical name for the given name and email address pair
      Parameter:
      name - The actual name from a commit
      mail - The actual email address from a commit
      Gibt zurück:
      The name matching a mapping in the mail map or the initial name
    • getCanonicalAuthorEmailAddress

      public String getCanonicalAuthorEmailAddress(GitCommit commit)
      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

      public String getCanonicalAuthorName(GitCommit commit)
      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

      public String getCanonicalCommitterEmailAddress(GitCommit commit)
      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

      public String getCanonicalCommitterName(GitCommit commit)
      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

      void parseMailMap() throws GitRepositoryException
      Tries to parse the .mailmap file from the worktree of the given repository.
      If the file exists and contains valid content exists() will return true.
      Löst aus:
      GitRepositoryException - if the .mailmap file cannot be read
      Siehe auch:
    • parseMailMap

      void parseMailMap(File mailMap) throws IOException
      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 exist
      IOException - if the .mailmap file cannot be read