I am trying to write a 'live git log' bash script. here is the code so far:
#!/bin/sh while true; do clear git log --graph -10 --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset" sleep 3 done
my problem is that the git log uses a pager and you have to press q to exit, or it will just sit there forever. is there any way to encode the quit command in bash? I tried echoing q, with no luck. (I saw another entry here suggesting echo "q"> / dev / console, but there is no developer console in my environment)
: win7 box - emulating bash with mingw (1.7.6.msysget.0)
UPDATE
here is the finished script
#!/bin/sh while true; do clear git log \ --graph \ --all \ --color \ --date=short \ -40 \ --pretty=format:"%C(yellow)%h%x20%C(white)%cd%C(green)%d%C(reset)%x20%s%x20%C(bold)(%an)%Creset" | cat - sleep 15 done
-40 is a personal taste. change it to any number that suits you and the size of your terminal.
xero
source share