Class KiwiGit

java.lang.Object
org.kiwiproject.beta.util.git.KiwiGit

@Beta public final class KiwiGit extends Object
  • Method Details

    • looksLikeShortGitHash

      public static boolean looksLikeShortGitHash(String value)
      Check whether the given input value looks like it is a short Git hash.

      This method considers a short Git hash to be a 7-12 character long String containing only valid hexadecimal characters. Specifically, valid hexadecimal characters include digits 0-9 and lowercase letters a-f. We only look for lowercase letters because we have never once seen git display a commit hash with uppercase letters.

      Read more about Git Short SHA-1 hashes.

      Parameters:
      value - the String to check
      Returns:
      true if the input String looks like a short Git hash