Returns the current commit hash

@return  string
188162
public function getCurrentCommit()
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'rev-parse'}($this->getRepositoryPath(), array(
             '--verify',
            'HEAD'
        ));
        $result->assertSuccess(sprintf('Cannot rev-parse "%s"', $this->getRepositoryPath()));
        return $result->getStdOut();
    }
581886
public function getHashCode()
    {
        return md5(
            ($this->visible ? 't' : 'f') .
            $this->blurRadius .
            $this->distance .
            $this->direction .
            $this->alignment .
            $this->color->getHashCode() .
            $this->alpha .
            __CLASS__
        );
    }
617836
protected function getCommitHash($hash = null)
    {
        if (!$hash) {
            $gClient = new GitClient(getcwd());
            return $gClient->getHashOfLatestCommit();
        }

        if (strlen($hash) != 40) {
            throw new \InvalidArgumentException(
                sprintf("Invalid git commit hash %s specified", $hash)
            );
        }

        return urlencode($hash);
    }
851355
public function getHash()
    {
        $hashes = array();

        foreach ($this->getPatches() as $patch) {
            $hashes[] = $patch->getHash();
        }
        sort($hashes);

        return sha1(implode(' ', $hashes));
    }
560042
public function getWriteHash(): string
    {
        $hash = hash_final($this->write_hash, true);
        if ($this->rev) {
            $hash = strrev($hash);
        }
        $this->write_hash = null;
        $this->write_check_after = 0;
        $this->write_check_pos = 0;

        return $hash;
    }
20901
public function showCommit($hash)
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'show'}($this->getRepositoryPath(), array(
            '--format' => 'fuller',
            $hash
        ));
        $result->assertSuccess(sprintf('Cannot retrieve commit "%s" from "%s"',
            $hash, $this->getRepositoryPath()
        ));

        return $result->getStdOut();
    }
225974
public function getCommitMessage()
    {
        $rtn = parent::getCommitMessage($this->data['commit_message']);

        $project = $this->getProject();

        if (!is_null($project)) {
            $reference = $project->getReference();
            $commitLink = '<a target="_blank" href="https://github.com/' . $reference . '/issues/$1">#$1</a>';
            $rtn = preg_replace('/\#([0-9]+)/', $commitLink, $rtn);
            $rtn = preg_replace('/\@([a-zA-Z0-9_]+)/', '<a target="_blank" href="https://github.com/$1">@$1</a>', $rtn);
        }

        return $rtn;
    }
698407
public function getHashCode()
    {
        return md5(
            $this->author .
            $this->text->getHashCode() .
            $this->width .
            $this->height .
            $this->marginLeft .
            $this->marginTop .
            ($this->visible ? 1 : 0) .
            $this->fillColor->getHashCode() .
            $this->alignment .
            __CLASS__
        );
    }
303349
def commit_hash(dir='.'):
    

    cmd = ['git', 'rev-parse', 'HEAD']

    try:
        with open(os.devnull, 'w') as devnull:
            revision_hash = subprocess.check_output(
                cmd,
                cwd=dir,
                stderr=devnull
            )
        if sys.version_info.major > 2:
            revision_hash = revision_hash.decode('ascii')

        return revision_hash.strip()

    except subprocess.CalledProcessError:
        return None
734012
public function getCommitLink()
    {
        $domain = $this->getProject()->getAccessInformation("domain");
        return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/commit/' . $this->getCommitId();
    }
1158762
public function getHash()
    {
        return md5(
            implode('', $this->scripts)
            . implode('', $this->files)
            . $this->mode
            . $this->warningLevel
            . $this->getFormattingOptions()->getPrettyPrintEnabled()
            . $this->getFormattingOptions()->getPrintInputDelimiterEnabled()
        );
    }
707126
public function getHashCode()
    {
        $hashConditionals = '';
        foreach ($this->conditionalStyles as $conditional) {
            $hashConditionals .= $conditional->getHashCode();
        }

        return md5(
            $this->fill->getHashCode() .
            $this->font->getHashCode() .
            $this->borders->getHashCode() .
            $this->alignment->getHashCode() .
            $this->numberFormat->getHashCode() .
            $hashConditionals .
            $this->protection->getHashCode() .
            ($this->quotePrefix  ? 't' : 'f') .
            __CLASS__
        );
    }
198106
public function getCommitMode() {
		if (is_null($this->_commitMode)) {
			if ($this->getAttribute(PDO::ATTR_AUTOCOMMIT)) {
				return OCI_COMMIT_ON_SUCCESS;
			}
			else {
				return ((PHP_VERSION_ID >= 503020) ? OCI_NO_AUTO_COMMIT : OCI_DEFAULT);
			}
		}

		return $this->_commitMode;
	}
91704
public function getHashCode() {
		if ($this->_isSupervisor) {
			return $this->getSharedComponent()->getHashCode();
		}
		return md5(
			  $this->_horizontal
			. $this->_vertical
			. $this->_textRotation
			. ($this->_wrapText ? 't' : 'f')
			. ($this->_shrinkToFit ? 't' : 'f')
			. $this->_indent
			. __CLASS__
		);
	}
609853
public function getHashCode() {
		if ($this->_isSupervisor) {
			return $this->getSharedComponent()->getHashCode();
		}
		return md5(
			  $this->_borderStyle
			. $this->_color->getHashCode()
			. __CLASS__
		);
	}
784508
def commit_hash(self):
        
        commit_hash = None
        branch = None
        branch_file = '.git/HEAD'  # ref: refs/heads/develop

        # get current branch
        if os.path.isfile(branch_file):
            with open(branch_file, 'r') as f:
                try:
                    branch = f.read().strip().split('/')[2]
                except IndexError:
                    pass

            # get commit hash
            if branch:
                hash_file = '.git/refs/heads/{}'.format(branch)
                if os.path.isfile(hash_file):
                    with open(hash_file, 'r') as f:
                        commit_hash = f.read().strip()
        return commit_hash
363530
public function commitTransaction() {
        $this->_fireEvent('phpsweetpdo.commit_transaction.started', array ());
        $result = $this->_pdoObject->commit();
        $this->_fireEvent('phpsweetpdo.commit_transaction.finished', array ('result' => &$result));

        return $result;
    }