rougail-tutorials/next.sh

14 lines
312 B
Bash
Raw Normal View History

2023-12-18 11:34:29 +01:00
#!/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