It can be easily added via libgit to avoid boilerplate scripts like:
# Instead of
@cur-branch:
echo Current branch is $(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
# Will possible write
@cur-branch:
echo Current branch is {{git_branch()}}
I suggest next functions:
- git_repo - (path to root of current repo)
- git_branch - (current branch)
- git_revision - (hash of latest commit)
git_tag - (latest tag)
- git_is_dirty - (is current branch dirty)
It can be easily added via libgit to avoid boilerplate scripts like:
I suggest next functions:
git_tag - (latest tag)