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
|
fi
|
||||||
|
|
||||||
# Display the commits in the above format and pipe that into fzf.
|
# Display the commits in the above format and pipe that into fzf if stdout is a
|
||||||
git log "$formatshort" "$dateshort" --color=always "$@" \
|
# terminal.
|
||||||
| env LESS="$LESS${LESS:+ }-+F" fzf "${fzf_args[@]}"
|
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
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user