Skip to content

Instantly share code, notes, and snippets.

@attacker34
Forked from jobertabma/git-inspect.sh
Created December 13, 2017 05:26
Show Gist options
  • Save attacker34/94d15586e046b646a8b5045bd71d7ef8 to your computer and use it in GitHub Desktop.
Save attacker34/94d15586e046b646a8b5045bd71d7ef8 to your computer and use it in GitHub Desktop.
A script to manually iterate over git commits. Use qj/qk to navigate.
DIFF_NUMBER=1
while read -n1 -r -p "$DIFF_NUMBER:" && [[ $REPLY != q ]]; do
case $REPLY in
j)
DIFF_NUMBER=`expr $DIFF_NUMBER + 1`
;;
k)
DIFF_NUMBER=`expr $DIFF_NUMBER - 1`
;;
*)
esac
git diff HEAD~$DIFF_NUMBER..HEAD~`expr $DIFF_NUMBER - 1`
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment