Re: [PATCH v3 0/6] use the pager in 'add -p'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024-06-05 15:21, Phillip Wood wrote:
On 05/06/2024 10:09, Jeff King wrote:
On Tue, Jun 04, 2024 at 08:32:04AM -0700, Junio C Hamano wrote:

Given that the main use case for "|" is for human viewing through a
pager, I think the colorful, filtered version meant for users is the
best default. And then the "bare" version can come from an alternate
command or a knob.

I think that's a very good point. It is hard to see what "|" can be
used for other than viewing the hunk as (a) git does not read the
output so it cannot be used to filter or edit the hunk that is applied
and (b) we pass an isolated hunk so the post-image offset in the hunk
header is likely to be wrong and there is no indication as to which
file it comes from so the program being run cannot apply the hunk
itself. Having the escape codes does make it harder to filter the
hunk. For example to just look at the post-image as one needs to do
something like

	grep '^[^-+ @]*[+ @]'

instead of just using '^[+ @]' as the pattern but the bonus is that
the output is colored.

Agreed, but as I already explained, [1] only when using the bare "|"
command.  When "|xyz" is used instead, the version of the hunk with
no coloring escape sequences should be piped to xyz.

[1] https://lore.kernel.org/git/844704794168f9fcb85c75014c84cde0@xxxxxxxxxxx/




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux