Skip to content

Commit e56a4ba

Browse files
committed
CodingGuidelines: document NEEDSWORK comments
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>
1 parent 9a2fb14 commit e56a4ba

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Documentation/CodingGuidelines

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ Git in general, a few rough rules are:
3333
achieve and why the changes were necessary (more on this in the
3434
accompanying SubmittingPatches document).
3535

36+
- A label "NEEDSWORK:" followed by description of the things to be
37+
done is a way to leave in-code comments to document design
38+
decisions yet to be made. 80% of the work to resolve a NEEDSWORK
39+
comment is to decide if it still makes sense to do so, since the
40+
situation around the codebase may have changed since the comment
41+
was written. It can be a very valid change to remove an existing
42+
NEEDSWORK comment without doing anything else, with the commit log
43+
message describing a good argument why it does not make sense to do
44+
the thing the NEEDSWORK comment mentioned.
45+
3646
Make your code readable and sensible, and don't try to be clever.
3747

3848
As for more concrete guidelines, just imitate the existing code

0 commit comments

Comments
 (0)