Re: [PATCH v2 8/8] hook-list.h: add a generated list of hooks, like config-list.h
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 27, 2021, 16:48 UTC
- Message-ID
- <xmqqfstqq80j.fsf@gitster.g>
- In-Reply-To
- <patch-v2-8.8-7420267ce09-20210926T185800Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 5 quoted lines
> +sed -n \
> + -e '/^~~~~*$/ {x; s/^.*$/ "&",/; p;}' \
> + -e 'x' \
> + <Documentation/githooks.txt |
> + LC_ALL=C sortThanks. It is not wrong per-se, but if you are willing to do a multi-line script for readability, wouldn't a much more readable "single long and multi-line string" approach, i.e.
sed -ne '
/^~~~~*$/ {
x
s/^.*$/ "&",/
p
}
x
' Documentation/githooks.txt |
LC_ALL=C sortwork better?