From: Junio C Hamano <gitster@pobox.com>
To: Deveshi Dwivedi <deveshigurgaon@gmail.com>
Cc: git@vger.kernel.org, peff@peff.net
Subject: Re: [PATCH 0/2] coccinelle: detect and fix strbuf-by-value parameters
Date: Mon, 16 Mar 2026 08:35:50 -0700 [thread overview]
Message-ID: <xmqq5x6vrdm1.fsf@gitster.g> (raw)
In-Reply-To: <20260315094445.19849-1-deveshigurgaon@gmail.com> (Deveshi Dwivedi's message of "Sun, 15 Mar 2026 09:44:42 +0000")
Deveshi Dwivedi <deveshigurgaon@gmail.com> writes:
> While reviewing the write_worktree_linking_files() fix [1], Jeff King
> suggested adding a coccinelle rule to detect functions that take
> struct strbuf by value. I previously posted an RFC discussing such a rule
> and its implementation [2].
>
> Patch 1/2 adds a coccinelle rule to detect functions that take
> struct strbuf by value and rewrites the parameter to a pointer
> to highlight the issue.
>
> Patch 2/2 fixes the one remaining instance found by the rule in
> stash.c by changing the parameter to struct strbuf * and
> updating the caller accordingly.
>
> The worktree.c instance that motivated the rule is already fixed
> by [1], so only the stash.c case remains.
Nicely done. Will queue. Thanks.
prev parent reply other threads:[~2026-03-16 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 9:44 [PATCH 0/2] coccinelle: detect and fix strbuf-by-value parameters Deveshi Dwivedi
2026-03-15 9:44 ` [PATCH 1/2] coccinelle: detect struct strbuf passed by value Deveshi Dwivedi
2026-03-15 9:44 ` [PATCH 2/2] stash: do not pass strbuf " Deveshi Dwivedi
2026-03-16 15:35 ` Junio C Hamano [this message]
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=xmqq5x6vrdm1.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=deveshigurgaon@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox