I have a couple of git repositories that belong together, and simple batch/bash file to loop over them. I often loop over them with a log command to quickly see what state t
Git has an option to disable the pager:
git --no-pager log --decorate=short --pretty=oneline -n1
If your pager cuts lines and you want to retain that behaviour, either pipe to cut
...
git --no-pager log --decorate=short --pretty=oneline -n1 | cut -c 1-$COLUMNS
...or set the environment variable GIT_PAGER
before the invocation:
GIT_PAGER="cut -c 1-${COLUMNS-80}" git --no-pager log --decorate=short --pretty=oneline -n1