Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Created October 28, 2017 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikermcneil/aad04147f9c39eaa3d4c6fbcf50b6dd4 to your computer and use it in GitHub Desktop.
Save mikermcneil/aad04147f9c39eaa3d4c6fbcf50b6dd4 to your computer and use it in GitHub Desktop.
echoSinceTagInfo()
{
if git describe --abbrev=0 --tags 1>/dev/null 2>/dev/null;
then
local LAST_TAG=`git describe --abbrev=0 --tags`;
local CHANGED_SINCE_LAST_TAG=`git diff ${LAST_TAG} --shortstat`;
if [ -z "${CHANGED_SINCE_LAST_TAG}" ]
then
echo "Tagged as ${LAST_TAG}"
return
fi
echo -e "Has untagged code changes since ${LAST_TAG}"
else
echo "No tags yet";
fi
}
alias gls='clear && echo "-• `pwd`" && echo && ls -G && echo && git branch && echo && echoSinceTagInfo && echo && git status && echo'
@mikermcneil
Copy link
Author

mikermcneil commented Oct 28, 2017

So then:

gls

Yields:
image

@mikermcneil
Copy link
Author

Or, for example:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment