"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.commitLogFromTagToHead=exports.commitLogBetweenTags=exports.latestTagOrFirstCommit=exports.firstCommit=exports.latestTag=void 0;var _execa=_interopRequireDefault(require("execa"));

const latestTag=()=>{const _execa$sync=
_execa.default.sync("git",["describe","--abbrev=0","--tags"]),stdout=_execa$sync.stdout;
return stdout;
};exports.latestTag=latestTag;

const firstCommit=()=>{const _execa$sync2=
_execa.default.sync("git",[
"rev-list",
"--max-parents=0",
"HEAD"]),stdout=_execa$sync2.stdout;

return stdout;
};exports.firstCommit=firstCommit;

const latestTagOrFirstCommit=()=>{
let latest;
try{

latest=latestTag();
}catch(_){

latest=firstCommit();
}

return latest;
};exports.latestTagOrFirstCommit=latestTagOrFirstCommit;

const commitLogBetweenTags=(from,to)=>{const _execa$sync3=
_execa.default.sync("git",[
"log",
"--format=%s %h",
`${from}..${to!==null&&to!==void 0?to:"HEAD"}`]),stdout=_execa$sync3.stdout;

return stdout;
};exports.commitLogBetweenTags=commitLogBetweenTags;

const commitLogFromTagToHead=from=>{const _execa$sync4=
_execa.default.sync("git",[
"log",
"--format=%s %h",
`${from}..HEAD`]),stdout=_execa$sync4.stdout;

return stdout;
};exports.commitLogFromTagToHead=commitLogFromTagToHead;