From: Eric Sunshine <sunshine@sunshineco.com>
To: David Aguilar <davvid@gmail.com>
Cc: Fernando Ramos <greenfoo@u92.eu>,
Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>, Seth House <seth@eseth.com>,
Philippe Blain <levraiphilippeblain@gmail.com>,
rogi@skylittlesystem.org
Subject: Re: [PATCH 2/3] vimdiff: add tool documentation
Date: Sun, 7 Nov 2021 20:02:22 -0500 [thread overview]
Message-ID: <CAPig+cSi9S+EdqKLNWDGA76B3kUbvxQHEh2csyZYqX2sf0gztQ@mail.gmail.com> (raw)
In-Reply-To: <CAJDDKr4icrigRO-2S_HVdY7+W0EGJ8XBn5dD=O-qy1tXym4u8w@mail.gmail.com>
On Sun, Nov 7, 2021 at 4:25 PM David Aguilar <davvid@gmail.com> wrote:
> On Thu, Nov 4, 2021 at 9:10 AM Fernando Ramos <greenfoo@u92.eu> wrote:
> > + 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).
> > + cat <<-ENDOFMESSAGE
> > + Opens vim with two vertical windows: LOCAL changes will be placed in the left
> > + window and REMOTE changes in the right one.
> > + ENDOFMESSAGE
>
> Tiny 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
next prev parent reply other threads:[~2021-11-08 1:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 16:09 [PATCH 0/3] vimdiff: new layout option + docs Fernando Ramos
2021-11-04 16:09 ` [PATCH 1/3] vimdiff: new implementation with layout support Fernando Ramos
2021-11-07 22:41 ` David Aguilar
2021-11-08 0:47 ` Eric Sunshine
2021-11-04 16:09 ` [PATCH 2/3] vimdiff: add tool documentation Fernando Ramos
2021-11-07 21:24 ` David Aguilar
2021-11-08 1:02 ` Eric Sunshine [this message]
2021-11-08 19:08 ` Junio C Hamano
2021-11-04 16:09 ` [PATCH 3/3] vimdiff: remove deprecated {,g,n}vimdiff{1,2,3} variants Fernando Ramos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cSi9S+EdqKLNWDGA76B3kUbvxQHEh2csyZYqX2sf0gztQ@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=greenfoo@u92.eu \
--cc=levraiphilippeblain@gmail.com \
--cc=rogi@skylittlesystem.org \
--cc=seth@eseth.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).