git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:08 UTC

Re: [RFC] cocci: .buf in a strbuf object can never be NULL

From
Jeff King <peff@peff.net>
Date
Mar 22, 2026, 01:40 UTC
Message-ID
<20260322014023.GA816875@coredump.intra.peff.net>
In-Reply-To
<xmqq5x6oac9t.fsf@gitster.g>
On Sat, Mar 21, 2026 at 06:22:38PM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Could the function be rewritten differently, or maybe even made a little
> > simpler? Perhaps, but who cares? The function has been largely untouched
> > for a decade and the behavior is fine. And there are a bunch of pitfalls
> > that a rewrite risks falling into.
> 
> Well, my only interest in this codepath was to get rid of "if
> (!sb->buf)" so that I can lift the special case in the Coccinelle
> rule.  Nothing else.
Yeah. IMHO it is better just to keep the special case.
-Peff
Previous: Junio C HamanoNext: Jeff King
Message 19 of 20 in “rerere: update to modern representation of empty strbufs”
  1. rerere: update to modern representation of empty strbufsJunio C Hamano, Mar 19, 2026
  2. Patrick SteinhardtMar 19, 2026
  3. [RFC] cocci: .buf in a strbuf object can never be NULLJunio C Hamano, Mar 19, 2026
  4. Jeff KingMar 19, 2026
  5. Junio C HamanoMar 20, 2026
  6. Jeff KingMar 20, 2026
  7. Junio C HamanoMar 20, 2026
  8. Jeff KingMar 20, 2026
  9. Junio C HamanoMar 20, 2026
  10. Jeff KingMar 20, 2026
  11. René ScharfeMar 21, 2026
  12. Junio C HamanoMar 21, 2026
  13. Jeff KingMar 21, 2026
  14. Jeff KingMar 21, 2026
  15. René ScharfeMar 21, 2026
  16. Jeff KingMar 21, 2026
  17. René ScharfeMar 21, 2026
  18. Junio C HamanoMar 22, 2026
  19. Jeff KingMar 22, 2026
  20. Jeff KingMar 22, 2026

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.