#!/bin/bash while read oldrev newrev refname do range="" # $oldrev may be "0000000000000000000000000000000000000000" in case if # the repo is empty, so we need to ignore range in that case and apply it # only for regular cases. if [[ ! "$oldrev" =~ ^0{1,}$ ]]; then range="$oldrev.." fi git log $range --pretty=format:'sha:%H, author:%ae, time:%ai' --no-merges > /tmp/logs.txt done