diff --git a/.config/zsh/autoload/glog b/.config/zsh/autoload/glog index e454d38..eb23f6b 100755 --- a/.config/zsh/autoload/glog +++ b/.config/zsh/autoload/glog @@ -29,29 +29,30 @@ local -a format=( '%-b' # body ) -# Before being able to operate on the string itself we need to remove all ansi -# color escape sequences to not confuse sed. (see git show below) -local del_ansi='s/\[[0-9]{0,2}m//g' # Ignore the graph part at the beginning, then capture the commit hash and throw # away the rest of the line. -local commit_hash='s/^[ */\\|]*([a-f0-9]+).*$/\1/' +local commit_hash='s/^[^a-f0-9]*([a-f0-9]*).*$/\1/' local dateshort='--date=format:%F' # year -local date='--date=format:%F %T %z' # year time timezone -local colors='--color=always' +local date="$dateshort %T %z" # year time timezone +# Put the commit hash into the clipboard +local fzf_copy_command="echo -n {} | sed -E '$commit_hash' | xclip -sel c" +# Execute git show on selected commit local fzf_preview_command read -r -d '' fzf_preview_command <