Ejemplo n.º 1
0
def validate_tag_or_commit_hash(ctx, value):
    if value != "Default is next tag in commit history following the release <tag> or <commit_hash>":
        try:
            git_commit_cmd = "git cat-file -t " + value
            git_commit = Utils().get_cmd_output(git_commit_cmd)[0]
        except subprocess.CalledProcessError:
            raise click.BadParameter("The <tag> or <commit hash> you entered doesn't exist.")
        return value
    def __found_needle(self, needle, line) -> bool:
        if Utils().is_sha1(needle) is True:
            haystack = CommitHashTranslation(line).apply()
            needle = GitUtils().get_short_sha(needle)
        else:
            haystack = TagTranslation(line).apply()

        return True if haystack == needle and needle is not None else False
Ejemplo n.º 3
0
 def __init__(self):
     self.utils = Utils()
 def verify(self) -> bool:
     is_valid = False
     if self.__regex(self.phrase) is not None or Utils().get_sha1(
             self.phrase) is not None:
         is_valid = True
     return is_valid
Ejemplo n.º 5
0
    def get_git_log(self) -> LogRepository:
        git_log_cmd = "git --no-pager log --decorate"
        git_log = Utils().get_cmd_output(git_log_cmd)

        log_translator = GitLogTranslator(git_log)
        return log_translator.translate(needle=self.previous_release)