Class AbbrevConfig

java.lang.Object
org.eclipse.jgit.lib.AbbrevConfig

public final class AbbrevConfig extends Object
Git configuration option core.abbrev
Since:
6.1
  • Field Details

    • MIN_ABBREV

      public static final int MIN_ABBREV
      The minimum value of abbrev
      See Also:
    • NO

      public static final AbbrevConfig NO
      No abbreviation
  • Method Details

    • capAbbrev

      public static int capAbbrev(int len)
      Cap configured core.abbrev to range between minimum of 4 and number of hex-digits of a full object id.
      Parameters:
      len - configured number of hex-digits to abbreviate object ids to
      Returns:
      core.abbrev capped to range between minimum of 4 and number of hex-digits of a full object id
    • parseFromConfig

      public static AbbrevConfig parseFromConfig(Repository repo) throws InvalidConfigurationException
      Parse string value of core.abbrev git option for a given repository
      Parameters:
      repo - repository
      Returns:
      the parsed AbbrevConfig
      Throws:
      InvalidConfigurationException - if value of core.abbrev is invalid
    • get

      public int get()
      Get the configured abbreviation length for object ids.
      Returns:
      the configured abbreviation length for object ids
    • toString

      public String toString()
      Overrides:
      toString in class Object