git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] userdiff: allow * between cpp funcname words

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Dec 6, 2011, 21:07 UTC
Message-ID
<4EDE83F7.6030708@lsrfire.ath.cx>
In-Reply-To
<4EDE8086.9080303@kdbg.org>
Am 06.12.2011 21:52, schrieb Johannes Sixt:
Show 32 quoted lines
> Am 06.12.2011 21:19, schrieb Jeff King:
>> On Tue, Dec 06, 2011 at 09:17:56PM +0100, Thomas Rast wrote:
>>
>>>> Looks reasonable to me. You can see the difference, for instance, with:
>>>>
>>>>    git show -U1 3c73a1d
>>>>
>>>> (The -U1 is because of the annoying "we will start looking for the
>>>> header at the top of context, not the top of changes" behavior I
>>>> mentioned last week).
>>>
>>> Actually (sadly) I'll have to revise it.  It doesn't match much of C++
>>> either, and I haven't yet come up with a reasonable regex that
>>> matches, say,
>>>
>>>    foo::Bar<int>::t&  Baz::operator<<(
>>>
>>> which I would call ludicrous, but it's valid C++.
>>
>> Ick, yeah. Maybe it is worth doing the "*" thing for now, and then
>> worrying about advanced C++ stuff on top as another patch. AFAICT, your
>> original patch is a strict improvement.
>
> Excuse me, where's the problem? The above example shows this
>
> @@ -105,8 +105,8 @@ char *url_decode(const char *url)
>          struct strbuf out = STRBUF_INIT;
> -       const char *slash = strchr(url, '/');
> +       const char *colon = strchr(url, ':');
> ...
>
> with current 4cb5d10b. This looks quite correct, no?

That's with the default heuristic; try something like this first to turn on userdiff:

	$ echo url.c diff=cpp >>.gitattributes
René
Previous: Johannes SixtNext: Junio C Hamano
Message 6 of 9 in “userdiff: allow * between cpp funcname words”
  1. userdiff: allow * between cpp funcname wordsThomas Rast, Dec 6, 2011
  2. Jeff KingDec 6, 2011
  3. Thomas RastDec 6, 2011
  4. Jeff KingDec 6, 2011
  5. Johannes SixtDec 6, 2011
  6. René ScharfeDec 6, 2011
  7. Junio C HamanoDec 6, 2011
  8. Thomas RastDec 7, 2011
  9. Johannes SixtDec 7, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.