git-repo-info
Retrieves repo information without relying on the git
command.
Usage
var getRepoInfo = ; var info = ; infobranch // current branchinfosha // current shainfoabbreviatedSha // first 10 chars of the current shainfotag // tag for the current sha (or `null` if no tag exists)infolastTag // tag for the closest tagged ancestor // (or `null` if no ancestor is tagged)infocommitsSinceLastTag // number of commits since the closest tagged ancestor // (`0` if this commit is tagged, or `Infinity` if no ancestor is tagged)infocommitter // committer for the current shainfocommitterDate // commit date for the current shainfoauthor // author for the current shainfoauthorDate // authored date for the current shainfocommitMessage // commit message for the current shainforoot // root directory for the Git repo or submodule // (if in a worktree, this is the directory containing the original copy)infocommonGitDir // directory containing Git metadata for this repo or submodule // (if in a worktree, this is the primary Git directory for the repo)infoworktreeGitDir // if in a worktree, the directory containing Git metadata specific to // this worktree; otherwise, this is the same as `commonGitDir`.
When called without any arguments, git-repo-info
will automatically lookup upwards
into parent directories to find the first match with a .git
folder.
If passed an argument, it will be assumed to be the path to the repo's .git
folder
to inspect.