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

Re: [PATCH] CodingGuidelines: document NEEDSWORK comments

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 12, 2026, 07:10 UTC
Message-ID
<aY1892Rzp1bQsLoW@pks.im>
In-Reply-To
<xmqqms1ft7il.fsf@gitster.g>
On Wed, Feb 11, 2026 at 11:17:06AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> We often say things like /* NEEDSWORK: further _do_ _this_ */ in
> comments, but it is a short-hand to say "We might later want to do
> this.  We might not.  We do not have to decide it right now at this
> moment in the commit this comment was added.  If somebody is
> inclined to work in this area further, the first thing they need to
> do is to figure out if it truly makes sense to do so, before blindly
> doing it.
> 
> This seems to have never been documented.  Do so now.

I noticed recently that there have been multiple patch series that blindly turn such NEEDSWORK comments into code. But I agree with you, the first and most important thing that such an author would need to worry about is whether the comment still applies, and what the ramifications of it are.

I almost feel as if NEEDSWORK is a bit of a misnomer, and that something like NEEDSTHOUGHTS would be a much better fit. But I don't have any intent to change that throughout our code base right now.

Show 16 quoted lines
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index df72fe0177..b358d6bfb8 100644
> --- a/Documentation/CodingGuidelines
> +++ b/Documentation/CodingGuidelines
> @@ -33,6 +33,15 @@ Git in general, a few rough rules are:
>     achieve and why the changes were necessary (more on this in the
>     accompanying SubmittingPatches document).
>  
> + - A label "NEEDSWORK:" followed by description of the things to be
> +   done is a way to leave in-code comments to document design
> +   decisions yet to be made. 80% of the work to resolve a NEEDSWORK
> +   comment is to decide if it makes sense to do so.  It can be a very
> +   valid change to remove an existing NEEDSWORK comment without doing
> +   anything else, with the commit log message describing a good
> +   argument why it does not make sense to do the thing the NEEDSWORK
> +   comment mentioned.

Documenting is a good first step, but I have to wonder whether such authors would even discover this. But even if not, it means that we have an easy place to point to going forward.

Thanks!
Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 8 in “CodingGuidelines: document NEEDSWORK comments”
  1. CodingGuidelines: document NEEDSWORK commentsJunio C Hamano, Feb 11, 2026
  2. Patrick SteinhardtFeb 12, 2026
  3. Junio C HamanoFeb 12, 2026
  4. CodingGuidelines: document NEEDSWORK commentsJunio C Hamano, Feb 12, 2026
  5. D. Ben KnobleFeb 12, 2026
  6. Junio C HamanoFeb 12, 2026
  7. Oswald BuddenhagenFeb 14, 2026
  8. Junio C HamanoFeb 14, 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.