Thread (7 messages) 7 messages, 2 authors, 2023-03-17

Re: [PATCH 1/4] mailmap: drop debugging code

From: Eric Sunshine <hidden>
Date: 2023-03-17 20:08:58

On Fri, Mar 17, 2023 at 3:16 PM Jeff King [off-list ref] wrote:
There's some debugging code in mailmap.c which is only compiled if you
manually tweak the source to set DEBUG_MAILMAP. When it's not set, the
fallback noop uses static inline functions; we couldn't use macros here
because one of the functions is variadic (and variadic macros were
forbidden back then, but aren't now). As a result, this triggers
a -Wunused-parameter warning.

We have a few options here:

  1. Leave it be. Just mark it as UNUSED, or switch to a variadic macro.

  2. Assume the debugging code is useful, compile it always, and trigger
     it with a run-time flag (e.g., with a trace key). This is pretty
     easy to do, and carries a pretty small runtime cost.

  3. Assume the debugging is not very useful, and just rip it out. This
     matches what we did with a similar case in 69c5f17f11 (attr: drop
     DEBUG_ATTR code, 2022-10-06).

The debugging flag has been mentioned only three times on the list.
Once, when it was added in 2009:

  https://lore.kernel.org/git/cover.1234102794.git.marius@trolltech.com/ (local)

In 2013, when somebody fixed some compilation errors in the conditional
code (presumably because they used it while making other changes):

  https://lore.kernel.org/git/1373871253-96480-1-git-send-email-sunshine@sunshineco.com/ (local)

And finally it seemed to have been useful to somebody in 2021:

  https://lore.kernel.org/git/87eejswql6.fsf@evledraar.gmail.com/ (local)
Nit: s/2021/2020/
So it's not totally without value. On the other hand, it's not likely to
be useful to non-developers (and certainly isn't if you have to
recompile). And using a debugger or adding your own inspection code is
likely to be as useful. So I've just dropped the code entirely here.

Note that we do still have to mark a few parameters unused in callback
functions which are passed to string_list_clear_func(). Those get an
extra pointer with the string being cleared, which we previously fed to
the debugging code.

Signed-off-by: Jeff King <redacted>
---
I'm cc-ing folks from those earlier threads. If somebody really wants to
salvage it, I can prepare a patch converting it to a trace variable
instead, but absent any outcry, I'd go with this approach.
As one of the mentioned anonymous "sombody"s, I have no objection.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help