Skip to content

Instantly share code, notes, and snippets.

@dpjayasekara
Forked from deepal/git-pretty-log.sh
Created October 14, 2019 21:11
Show Gist options
  • Save dpjayasekara/1d7fe20dd110cf4048b8bafae56f1ef2 to your computer and use it in GitHub Desktop.
Save dpjayasekara/1d7fe20dd110cf4048b8bafae56f1ef2 to your computer and use it in GitHub Desktop.
#!/bin/bash
GIT_HOST=$(git remote -v | grep fetch | cut -d "@" -f2 | cut -d ":" -f1)
GIT_PROJECT=$(git remote -v | grep fetch | cut -d "@" -f2 | cut -d ":" -f2 | cut -d "." -f1)
GIT_URL="https://$GIT_HOST/$GIT_PROJECT"
TAG1=$1
TAG2=$2
if [ -z $2 ]
then
TAG2=""
else
TAG2=$2
fi
git log --pretty=format:'- [view commit]('$GIT_URL'/commit/%H) • %s (%an)' $TAG1$TAG2 | grep -v "Merge branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment