Skip to content

Instantly share code, notes, and snippets.

@jcasts
Created March 16, 2012 16:02
Show Gist options
  • Save jcasts/2050739 to your computer and use it in GitHub Desktop.
Save jcasts/2050739 to your computer and use it in GitHub Desktop.
#!/bin/bash
# bin/git-hlog
tags=( )
args=( )
tags_done=0
for arg in $@; do
if [ ${arg:0:1} = "-" ]; then
tags_done=1
fi
if [ $tags_done -eq 1 ]; then
args[${#args[*]}]="$arg"
else
tags[${#tags[*]}]="--grep=#$arg"
fi
done
git log ${tags[@]} --all-match ${args[@]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment