fuzz-edit-diff-line (313B)
1 #!/usr/bin/env bash 2 3 set -eou pipefail 4 5 cdup=$(git rev-parse --show-cdup) 6 7 res=$(git diff "$@" | 8 showlinenum show_path=1 | 9 grep -E ':\+' | 10 fzf --ansi) 11 12 file_line=$(<<<"$res" sed -n "s,^\([^:]\+\):\([^:]\+\).*,\"${cdup}\1\" +\2,p") 13 line=$(<<<"$res" sed -En "s,.*:\+(.*)$,\1,p") 14 15 echo "edit $file_line # $line"