From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Oleg Nesterov" <oleg@redhat.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Calvin Wan" <calvinwan@google.com>,
"Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
"Elijah Newren" <newren@gmail.com>, "Jeff King" <peff@peff.net>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Mathias Krause" <minipli@grsecurity.net>,
"Taylor Blau" <me@ttaylorr.com>,
git@vger.kernel.org, "Alexey Gladkov" <legion@kernel.org>
Subject: Re: [PATCH 1/1] git-grep: improve the --show-function behaviour
Date: Thu, 14 Sep 2023 21:34:34 +0200 [thread overview]
Message-ID: <29ea79e7-87fd-fa27-e9df-d626e27c7c74@web.de> (raw)
In-Reply-To: <xmqq1qf2lxrm.fsf@gitster.g>
Am 13.09.23 um 02:31 schrieb Junio C Hamano:
> René Scharfe <l.s.r@web.de> writes:
>
>>>> To me, this behaviour looks as
>>>>
>>>> Show the preceding line that contains the function name of
>>>> the match, unless the _PREVIOUS_ matching line is a function
>>>> name itself.
>>
>> To me it looks like:
>>
>> Show the preceding line that contains the function name of
>> the match.
>>
>> ("Show" meaning "show once", not "show for each match again and again".)
>>
>> Or:
>>
>> Show the preceding line that contains the function name of
>> the match, unless it is already shown for a different
>> reason, e.g. as a match or as the function line of a
>> previous match.
>
> Wow, that was a mouthful, but matches my understanding. I naïvely
> thought "when showing a hit, we may add the line that matches the
> function header pattern before the hit even that header line does
> not hit the grep pattern. But if the header line does hit the grep
> pattern, we do not bother show the same thing twice." was a
> reasonable goal to have.
I agree, and that's probably why I included the "unless the matching
line is a function name itself" part. Not sure why the code doesn't
agree. A test for that aspect would have been nice. *ahem*
René
next prev parent reply other threads:[~2023-09-14 19:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 12:11 [PATCH 0/1] git-grep: improve the --show-function behaviour Oleg Nesterov
2023-09-11 12:12 ` [PATCH 1/1] " Oleg Nesterov
2023-09-11 20:11 ` René Scharfe
2023-09-11 21:54 ` Oleg Nesterov
2023-09-11 22:34 ` Junio C Hamano
2023-09-11 23:17 ` Oleg Nesterov
2023-09-12 13:04 ` Oleg Nesterov
2023-09-12 13:51 ` Oleg Nesterov
2023-09-12 18:07 ` René Scharfe
2023-09-13 0:31 ` Junio C Hamano
2023-09-13 9:46 ` Oleg Nesterov
2023-09-14 19:34 ` René Scharfe
2023-09-17 16:44 ` Oleg Nesterov
2023-09-14 19:34 ` René Scharfe [this message]
2023-09-13 10:15 ` Oleg Nesterov
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=29ea79e7-87fd-fa27-e9df-d626e27c7c74@web.de \
--to=l.s.r@web.de \
--cc=avarab@gmail.com \
--cc=calvinwan@google.com \
--cc=carenas@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=legion@kernel.org \
--cc=me@ttaylorr.com \
--cc=minipli@grsecurity.net \
--cc=newren@gmail.com \
--cc=oleg@redhat.com \
--cc=peff@peff.net \
--cc=torvalds@linux-foundation.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.