commit 09b92ca6441427835e21b3209ea7953a958cd03f
parent 0b49889fcdafe08dd33a36b2bbd3985fddb0e875
Author: William Casarin <jb55@jb55.com>
Date: Wed, 5 May 2021 11:08:31 -0700
fuzz-edit-diff-line: make git path relative
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/fuzz-edit-diff-line b/bin/fuzz-edit-diff-line
@@ -2,10 +2,12 @@
set -eou pipefail
+cdup=$(git rev-parse --show-cdup)
+
file_line=$(git diff "$@" |
showlinenum show_path=1 |
grep -E ':\+' |
fzf --ansi |
- sed -n 's,^\([^:]\+\):\([^:]\+\).*,"\1" +\2,p')
+ sed -n "s,^\([^:]\+\):\([^:]\+\).*,\"${cdup}\1\" +\2,p")
echo "edit $file_line"