Re: [PATCH 2/3] vimdiff: add tool documentation
From: Eric Sunshine <hidden>
Date: 2021-11-08 01:02:46
On Sun, Nov 7, 2021 at 4:25 PM David Aguilar [off-list ref] wrote:
On Thu, Nov 4, 2021 at 9:10 AM Fernando Ramos [off-list ref] wrote:quoted
+ while IFS= read -r line + do + printf "%s\t%s\n" "$per_line_prefix" "$line" + done < <(diff_mode && diff_cmd_help "$toolname" || merge_cmd_help "$toolname")If we wanted to shorten this line a bit, would it work to run the pipeline first and pipe the result? (diff_mode && ... || merge_cmd_help ...) | while IFS= read -r line do ... done
The additional benefit is that this avoids the `<(...)` Bashism (which you mentioned in your other review).
quoted
+ cat <<-ENDOFMESSAGE + Opens vim with two vertical windows: LOCAL changes will be placed in the left + window and REMOTE changes in the right one. + ENDOFMESSAGETiny nit: we call this EOF in the other places (git-mergetool--helper.sh) where we do the same. ENDOFMESSAGE is a bit verbose so it might be worth sticking to the conventional EOF marker.
A couple additional really micro nits (take them or leave them)...
We normally don't add extra indentation to the here-doc body, and we
use `<<-\EOF` to reduce cognitive load if there's nothing in the body
which requires interpolation or expansion. Thus:
cat <<-\EOF
Opens vim with two...
EOF