Based on this answer from SO, you can stop the need to quit by adding --no-pager
immediately after the git
.
It's not the log
command that is waiting for q
, it's the less
tool that is doing the pagination. By telling git
that you don't want the pager, the log
command will print all output and then quit immediately.
Of course if there is more than one screen worth, you'll get everything printed out and would have to scroll up to see the most recent commits. You can combat this by limiting the number of commits to log by adding something like -22
. That would limit to 22 commits, you could of course pick a different number.
Something like:
while :
do
clear
git --no-pager log --all --decorate --oneline -22 --graph
sleep 1
done