Get the commit sha for a given tag.

@param {String} tagName Tag name for which to retrieve the commit sha.
@param {Object} [execaOpts] Options to pass to `execa`.

@return {string} The commit sha of the tag in parameter or `null`.
351145
async function getTagHead(tagName, execaOpts) {
  try {
    return await execa.stdout('git', ['rev-list', '-1', tagName], execaOpts);
  } catch (error) {
    debug(error);
  }
}
57907
def fetch_date_of_tag(tag)
      commit_data = fetch_commit(tag["commit"]["sha"])
      commit_data = stringify_keys_deep(commit_data.to_hash)

      commit_data["commit"]["committer"]["date"]
    end
1135672
def get_sha(self) -> str:
        
        current_sha: str = self.repo.head.commit.hexsha
        LOGGER.debug('current commit SHA: %s', current_sha)
        return current_sha
125300
function getValueQuery(tagInfo) {
        var query;
        if (tagInfo.token.string === "=") {
            return "";
        }
        // Remove quotation marks in query.
        query = tagInfo.token.string.substr(1, tagInfo.offset - 1);

        // Get the last option to use as a query to support multiple options.
        return query.split(/\s+/).slice(-1)[0];
    }
924480
def string_to_hash(markup)
      options = {}

      if match = markup.match(Syntax)
        markup.scan(TagAttributes) do |key, value|
          options[key.to_sym] = value.gsub(/\A"|"\z/, "")
        end
      end

      options
    end
94083
def git_tag(tag_name, push=False):
    
    with chdir(get_root()):
        result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)

        if push:
            if result.code != 0:
                return result
            return run_command('git push origin {}'.format(tag_name), capture=True)

        return result
105071
public Ref checkoutTag(Git git, String tag) {
        try {
            return git.checkout()
                .setName("tags/" + tag).call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }
385787
def for_commit(commit, cmd_options={})
      [].tap do |returning|
        data = hg(["diff -c ?", commit.hash_id], cmd_options)
        chunks = data.split(/^diff/)[1..-1]
        unless chunks.nil?
          chunks.map do |piece| 
            piece = "diff" << piece
            returning << build(piece)
          end
        end
      end
    end
1026408
def fetch_commit(commit_id)
      found = commits.find do |commit|
        commit["sha"] == commit_id
      end
      if found
        stringify_keys_deep(found.to_hash)
      else
        # cache miss; don't add to @commits because unsure of order.
        check_github_response do
          commit = @client.commit(user_project, commit_id)
          commit = stringify_keys_deep(commit.to_hash)
          commit
        end
      end
    end
3292
async function getTags(execaOpts) {
  return (await execa.stdout('git', ['tag'], execaOpts))
    .split('\n')
    .map(tag => tag.trim())
    .filter(Boolean);
}
1169784
def load_tags
      Hash[@grit_repo.tags.map { |b| [b.name, b.commit.id] }]
    end
734073
function getSHA() {
      git.exec(versionOptions, function(error, version) {
        version = version.trim();
        createRelease(version);
      });
    }
1227985
def tag(self, sha):
        
        json = None
        if sha:
            url = self._build_url('git', 'tags', sha, base_url=self._api)
            json = self._json(self._get(url), 200)
        return Tag(json) if json else None
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)));
            });
        });
    }
404157
function getHash (transaction) {
	var bytes = getBytes(transaction);
	return crypto.createHash('sha256').update(bytes).digest();
}
970552
async function getTagCommit(githubRepo, tag) {
  const cachedResult = await renovateCache.get(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`)
  );
  // istanbul ignore if
  if (cachedResult) {
    return cachedResult;
  }
  let digest;
  try {
    const url = `https://api.github.com/repos/${githubRepo}/git/refs/tags/${tag}`;
    digest = (await ghGot(url)).body.object.sha;
  } catch (err) {
    logger.info(
      { githubRepo, err },
      'Error getting tag commit from GitHub repo'
    );
  }
  if (!digest) {
    return null;
  }
  const cacheMinutes = 120;
  await renovateCache.set(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`),
    digest,
    cacheMinutes
  );
  return digest;
}
429870
def for_commit(hash_id, cmd_options={})
      hg_to_array(["log -r 'descendants(?) and head()' --template '\n{branches}'", hash_id], {}, cmd_options) do |line|
        build_with_name_only(line)
      end.compact.uniq
    end