Last active
August 20, 2021 15:40
-
-
Save gbroques/109615d7304bfea189c09c2709d77e96 to your computer and use it in GitHub Desktop.
Watch HEAD on Git Bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/espaciomore/28e24ce4f91177c0964f4f67bb5c5fda | |
# https://gist.github.com/gbroques/80ec85c6557e70deb845d79c6b44fcf0 | |
ARGS="${@}" | |
clear; | |
while(true); do | |
OUTPUT=$(cat .git/HEAD) | |
ref=$(echo $OUTPUT | awk '{print $2}' | xargs -I {} cat .git/{}) | |
commit_message=$(git log --format=%B -n 1 $ref) | |
clear | |
printf "\n HEAD\n" | |
echo -e " ${OUTPUT[@]}" | |
printf "\n ref:\n" | |
echo -e " ${ref}" | |
printf "\n" | |
echo -e " ${commit_message}" | |
sleep 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment