zsh:glog: Only pipe to fzf if stdout is a tty
This makes it easy to use `glog` in a pipe as replacement for `git log --oneline`, for example to count the commits.
This commit is contained in:
@@ -127,7 +127,12 @@ else
|
||||
)
|
||||
fi
|
||||
|
||||
# Display the commits in the above format and pipe that into fzf.
|
||||
git log "$formatshort" "$dateshort" --color=always "$@" \
|
||||
| env LESS="$LESS${LESS:+ }-+F" fzf "${fzf_args[@]}"
|
||||
# Display the commits in the above format and pipe that into fzf if stdout is a
|
||||
# terminal.
|
||||
if [ -t 1 ]; then
|
||||
git log "$formatshort" "$dateshort" --color=always "$@" \
|
||||
| env LESS="$LESS${LESS:+ }-+F" fzf "${fzf_args[@]}"
|
||||
else
|
||||
git log "$formatshort" "$dateshort" --color=always "$@"
|
||||
fi
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user