# [PATCH] CodingGuidelines: document // comments

2 messages from 2026-02-11 to 2026-02-12. Participants: Junio C Hamano, Patrick Steinhardt.
Thread: https://gitlist.dev/t/64981

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

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

```
We do not use // comments in our C code, which is implied by the
description of multi-line comment rule and its examples, but is not
explicitly spelled out.  Spell it out.

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

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index b358d6bfb8..507d52b0d3 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -439,6 +439,8 @@ For C programs:
 	 */
 	_("Here is a translatable string explained by the above.");
 
+   We do not use // comments.
+
  - Double negation is often harder to understand than no negation
    at all.
 
-- 
2.53.0-247-g50a2c88be3


```

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

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

```
On Wed, Feb 11, 2026 at 11:17:48AM -0800, Junio C Hamano wrote:
> We do not use // comments in our C code, which is implied by the
> description of multi-line comment rule and its examples, but is not
> explicitly spelled out.  Spell it out.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  Documentation/CodingGuidelines | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index b358d6bfb8..507d52b0d3 100644
> --- a/Documentation/CodingGuidelines
> +++ b/Documentation/CodingGuidelines
> @@ -439,6 +439,8 @@ For C programs:
>  	 */
>  	_("Here is a translatable string explained by the above.");
>  
> +   We do not use // comments.
> +
>   - Double negation is often harder to understand than no negation
>     at all.

Makes sense and looks good to me. Thanks!

Patrick

```
