# [PATCH] CodingGuidelines: document NEEDSWORK comments

8 messages from 2026-02-11 to 2026-02-14. Participants: Junio C Hamano, Patrick Steinhardt, D. Ben Knoble, Oswald Buddenhagen.
Thread: https://gitlist.dev/t/64980

## Junio C Hamano, 2026-02-11 19:17

Subject: [PATCH] CodingGuidelines: document NEEDSWORK comments
Message-ID: <xmqqms1ft7il.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqms1ft7il.fsf%40gitster.g

```
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.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/CodingGuidelines | 9 +++++++++
 1 file changed, 9 insertions(+)

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.
+
 Make your code readable and sensible, and don't try to be clever.
 
 As for more concrete guidelines, just imitate the existing code
-- 
2.53.0-247-g50a2c88be3


```

## Patrick Steinhardt, 2026-02-12 07:10

Subject: Re: [PATCH] CodingGuidelines: document NEEDSWORK comments
Message-ID: <aY1892Rzp1bQsLoW@pks.im>
URL: https://gitlist.dev/e/aY1892Rzp1bQsLoW%40pks.im
In-Reply-To: <xmqqms1ft7il.fsf@gitster.g>

```
On Wed, Feb 11, 2026 at 11:17:06AM -0800, Junio C Hamano wrote:
> 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.

> 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

```

## Junio C Hamano, 2026-02-12 15:35

Subject: Re: [PATCH] CodingGuidelines: document NEEDSWORK comments
Message-ID: <xmqq7bsiq8k3.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq7bsiq8k3.fsf%40gitster.g
In-Reply-To: <aY1892Rzp1bQsLoW@pks.im>

```
Patrick Steinhardt <ps@pks.im> writes:

> 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.

I somewhat disagree with this, by the way.  Thinking has to be the
first step of working for anybody.  It is not like somebody thinks
things through thoroughly and writes an instruction to do these in
comments, only to be implemented by somebody else who does not have
to think.

>> 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.

I wonder if adding a "still" there, i.e.,

    ... decide if it still makes sense to do so.

makes our intent clearer.

> 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.

Yup.

Thanks.

```

## Junio C Hamano, 2026-02-12 21:22

Subject: [PATCH v2] CodingGuidelines: document NEEDSWORK comments
Message-ID: <xmqqldgxmzbj.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqldgxmzbj.fsf%40gitster.g
In-Reply-To: <xmqqms1ft7il.fsf@gitster.g>

```
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.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * reworded with a bit more stress on the possibility that the
   rationale behind NEEDSWORK comment may have gotten stale.

 Documentation/CodingGuidelines | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index df72fe0177..318829d4e4 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -33,6 +33,16 @@ 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 still makes sense to do so, since the
+   situation around the codebase may have changed since the comment
+   was written.  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.
+
 Make your code readable and sensible, and don't try to be clever.
 
 As for more concrete guidelines, just imitate the existing code

Interdiff against v1:
  diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
  index b358d6bfb8..318829d4e4 100644
  --- a/Documentation/CodingGuidelines
  +++ b/Documentation/CodingGuidelines
  @@ -36,11 +36,12 @@ Git in general, a few rough rules are:
    - 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.
  +   comment is to decide if it still makes sense to do so, since the
  +   situation around the codebase may have changed since the comment
  +   was written.  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.
   
   Make your code readable and sensible, and don't try to be clever.
   
-- 
2.53.0-248-g282ed54c8f



```

## D. Ben Knoble, 2026-02-12 22:22

Subject: Re: [PATCH v2] CodingGuidelines: document NEEDSWORK comments
Message-ID: <CALnO6CAjd0vbi0S+giYBwsyQwFmSZoWUBQMKiUEokCEeaNTnrQ@mail.gmail.com>
URL: https://gitlist.dev/e/CALnO6CAjd0vbi0S%2BgiYBwsyQwFmSZoWUBQMKiUEokCEeaNTnrQ%40mail.gmail.com
In-Reply-To: <xmqqldgxmzbj.fsf@gitster.g>

```
Small nit:

On Thu, Feb 12, 2026 at 4:23 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> 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.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>

The opening quote '"We might later…' doesn't appear to ever get closed.

```

## Junio C Hamano, 2026-02-12 22:33

Subject: Re: [PATCH v2] CodingGuidelines: document NEEDSWORK comments
Message-ID: <xmqq3435mw18.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq3435mw18.fsf%40gitster.g
In-Reply-To: <CALnO6CAjd0vbi0S+giYBwsyQwFmSZoWUBQMKiUEokCEeaNTnrQ@mail.gmail.com>

```
"D. Ben Knoble" <ben.knoble@gmail.com> writes:

> Small nit:
>
> On Thu, Feb 12, 2026 at 4:23 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> 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.
>>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> The opening quote '"We might later…' doesn't appear to ever get closed.

Yikes.  Thanks for spotting.

```

## Oswald Buddenhagen, 2026-02-14 10:19

Subject: Re: [PATCH v2] CodingGuidelines: document NEEDSWORK comments
Message-ID: <aZBMQGQPiE3cJBUq@ugly.lan>
URL: https://gitlist.dev/e/aZBMQGQPiE3cJBUq%40ugly.lan
In-Reply-To: <xmqqldgxmzbj.fsf@gitster.g>

```
On Thu, Feb 12, 2026 at 01:22:56PM -0800, Junio C Hamano wrote:
>+ - A label "NEEDSWORK:" followed by description of the things to be
>
by [a] description

```

## Junio C Hamano, 2026-02-14 15:36

Subject: Re: [PATCH v2] CodingGuidelines: document NEEDSWORK comments
Message-ID: <xmqqms1bgww8.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqms1bgww8.fsf%40gitster.g
In-Reply-To: <aZBMQGQPiE3cJBUq@ugly.lan>

```
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:

> On Thu, Feb 12, 2026 at 01:22:56PM -0800, Junio C Hamano wrote:
>>+ - A label "NEEDSWORK:" followed by description of the things to be
>>
> by [a] description

Thanks.

```
