:calls: `GET /repos/:owner/:repo/commits/:sha <http://developer.github.com/v3/repos/commits>`_
        :param sha: string
        :rtype: :class:`github.Commit.Commit`
554558
def get_commit(self, sha):
        
        assert isinstance(sha, (str, unicode)), sha
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/commits/" + sha
        )
        return github.Commit.Commit(self._requester, headers, data, completed=True)
656015
def last_commits(commit_sha, files_matcher)
      read_if_needed
      acceptable = commits_from(commit_sha)

      matches = {}

      if files_matcher.is_a? Regexp
        files = @all_files.keys.select { |file| file =~ files_matcher }
        files_matcher = files
      end

      if files_matcher.is_a? Array
        # find the last commit for each file in the array
        files_matcher.each do |f|
          @all_files[f].each do |try|
            if acceptable.include?(try)
              matches[f] = try
              break
            end
          end if @all_files[f]
        end
      end

      matches
    end
994540
def get_sha(path=None, log=None, short=False, timeout=None):
    
    # git_command = "git rev-parse HEAD {}".format(repo_name).split()
    # git_command = "git rev-parse HEAD".split()
    git_command = ["git", "rev-parse"]
    if short:
        git_command.append("--short")
    git_command.append("HEAD")

    kwargs = {}
    if path is not None:
        kwargs['cwd'] = path
    if timeout is not None:
        kwargs['timeout'] = timeout

    if log is not None:
        log.debug("{} {}".format(git_command, str(kwargs)))

    sha = subprocess.check_output(git_command, **kwargs)
    try:
        sha = sha.decode('ascii').strip()
    except:
        if log is not None:
            log.debug("decode of '{}' failed".format(sha))

    return sha
1253305
def patch_ref(self, sha):
        
        uri = "{api}/repos/{origin}/git/refs/heads/{branch}".format(
            api=self.github_api_url,
            origin=self.origin,
            branch=self.master_fork
        )
        data = {
            "sha": sha,
            "force": True
        }
        reply = self.request(
            "PATCH",
            uri,
            data=data
        )
        if reply.status_code == 200:
            dic = json.loads(reply.content.decode("utf-8"))
            return dic["object"]["sha"]
        else:
            dic = json.loads(reply.content.decode("utf-8"))
            return self.ProxyError(
                reply.status_code,
                (dic, "message"),
                step="patch",
                context={
                    "uri": uri,
                    "data": data
                }
            )
919541
public function getSingleCommit(string $sha): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha));
    }
1331764
def commit(self, sha):
        
        url = self._build_url('commits', sha, base_url=self._api)
        json = self._json(self._get(url), 200)
        return RepoCommit(json, self) if json else None
576107
def amended_commits(commits):
    """"""
    # which SHA1 are declared as amended later?
    amended_sha1s = []
    for message in commits.values():
        amended_sha1s.extend(re.findall(r'AMENDS\s([0-f]+)', message))
    return amended_sha1s
33632
def tree(self, sha):
        
        json = None
        if sha:
            url = self._build_url('git', 'trees', sha, base_url=self._api)
            json = self._json(self._get(url), 200)
        return Tree(json, self) if json else None
1194717
def get_commits(self, since_sha=None):
        
        assert self.tempdir

        cmd = ['git', 'log', '--first-parent', '--reverse', COMMIT_FORMAT]
        if since_sha:
            commits = [self.get_commit(since_sha)]
            cmd.append('{}..HEAD'.format(since_sha))
        else:
            commits = []
            cmd.append('HEAD')

        output = cmd_output(*cmd, cwd=self.tempdir)

        for sha, date in chunk_iter(output.splitlines(), 2):
            commits.append(Commit(sha, int(date)))

        return commits
771460
def commit(self, commit):
		
		req_message = 'https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/' + commit
		response_data = self._bitbucketAPIRequest(req_message)
		try:
			return self._commitData(response_data)
		except (ValueError, KeyError):
			raise KeyError("Commit %s not found" % commit)
1158590
def fetch_compare(older, newer)
      unless @compares["#{older}...#{newer}"]
        compare_data = check_github_response { @client.compare(user_project, older, newer || "HEAD") }
        raise StandardError, "Sha #{older} and sha #{newer} are not related; please file a github-changelog-generator issues and describe how to replicate this issue." if compare_data["status"] == "diverged"

        @compares["#{older}...#{newer}"] = stringify_keys_deep(compare_data.to_hash)
      end
      @compares["#{older}...#{newer}"]
    end
43490
def check_build_status(owner: str, repo: str, ref: str) -> bool:
        
        url = '{domain}/repos/{owner}/{repo}/commits/{ref}/status'
        response = requests.get(
            url.format(domain=Github.DOMAIN, owner=owner, repo=repo, ref=ref)
        )
        if debug_gh.enabled:
            debug_gh('check_build_status: state={}'.format(response.json()['state']))
        return response.json()['state'] == 'success'
197199
def get_commit(self, commit_id: str) -> Commit:
        
        return Commit(self.repo.commit(commit_id), self.path, self.main_branch)
530969
def match_associations(commit_sha, files)
        new_lines = lines_added(commit_sha)

        files = files.split("\n").group_by { |f| f.split('.').pop }

        associations.each do |ext, related|
          files[ext] ||= []
          related.each do |child|
            next if files[child].blank?

            files[child].each do |c|
              # hack to ignore deleted files
              files[child] = new_lines[c].blank? ? [] : [ filename: File.join(@config.working_dir, c), changes: new_lines[c] ]
            end
            files[ext].concat(files[child])
            files.delete(child)
          end
        end

        files.delete_if { |k,v| v.blank? || k.nil? }
        files
      end
856899
function get(id, callback) {
        _getSHA(id, function(err, sha) {
            if (err) return callback(err);
            repo.git.blobs(sha).fetch(function(err, res) {
                if (err) return callback(err);
                callback(err, JSON.parse(atob(res.content)));
            });
        });
    }
516639
def git_sha_metadata(content, git_content):
    '''
    
    '''
    if not content.settings['GIT_SHA_METADATA']:
        return

    if not git_content.is_committed():
        return

    content.metadata['gitsha_newest'] = str(git_content.get_newest_commit())
    content.metadata['gitsha_oldest'] = str(git_content.get_oldest_commit())
46979
def get_authors(repo_path, from_commit):
    
    repo = dulwich.repo.Repo(repo_path)
    refs = get_refs(repo)
    start_including = False
    authors = set()

    if from_commit is None:
        start_including = True

    for commit_sha, children in reversed(
        get_children_per_first_parent(repo_path).items()
    ):
        commit = get_repo_object(repo, commit_sha)
        if (
            start_including or commit_sha.startswith(from_commit) or
            fuzzy_matches_refs(from_commit, refs.get(commit_sha, []))
        ):
            authors.add(commit.author.decode())
            for child in children:
                authors.add(child.author.decode())

            start_including = True

    return '\n'.join(sorted(authors))