rougail-tutorials/next.sh

13 lines
312 B
Bash
Executable file

#!/bin/bash
BRANCH=1.0
CURRENT_LOG=$(git log --oneline|wc -l)
MAIN_LOG=$(git log --oneline $BRANCH|wc -l)
if [ $CURRENT_LOG = $MAIN_LOG ]; then
PAGE=$CURRENT_LOG
PAGE=$((PAGE-3))
else
PAGE=$((MAIN_LOG-CURRENT_LOG-2))
fi
git checkout $BRANCH 2> /dev/null
git checkout HEAD~$PAGE
git log --oneline -n1