<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/CodingGuidelines, branch v2.52.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.52.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.52.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-08-26T22:46:03Z</updated>
<entry>
<title>Documentation: note styling for bit fields</title>
<updated>2025-08-26T22:46:03Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-08-26T12:19:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=929b1d08f790938e147301a61c2dee4253cc3fa5'/>
<id>urn:sha1:929b1d08f790938e147301a61c2dee4253cc3fa5</id>
<content type='text'>
Our codebase uses a lot of bit field variables, generally to mark
boolean type variables. While there is a formatting rule in the
'.clang-format', there is no guideline specified in the
'CodingGuidelines'.

Since the '.clang-format' is not yet enforced, let's also add a
guideline with the same rule as mentioned in the '.clang-format', which
is to not use any spaces around the colon, like so:

    unsigned my_field:1;
    unsigned other_field:1;
    unsigned field_with_longer_name:1;

This would allow us not to modify the clang-format file, and more
importantly, discourage people from doing ugly alignment with spaces,
i.e.

    unsigned my_field               : 1;
    unsigned            other_field : 1;
    unsigned field_with_longer_name : 1;

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/doc-release-vs-clear'</title>
<updated>2025-08-04T15:10:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-04T15:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67424f5bcac94ec3b37ac2f76d2c742adaa8e54c'/>
<id>urn:sha1:67424f5bcac94ec3b37ac2f76d2c742adaa8e54c</id>
<content type='text'>
Doc update.

* jc/doc-release-vs-clear:
  CodingGuidelines: clarify that S_release() does not reinitialize
</content>
</entry>
<entry>
<title>Merge branch 'jc/document-test-balloons-in-flight'</title>
<updated>2025-08-01T18:27:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-01T18:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbcde15e7316a28f9deb49b4f48e9748b5a903d2'/>
<id>urn:sha1:cbcde15e7316a28f9deb49b4f48e9748b5a903d2</id>
<content type='text'>
To help our developers, document what C99 language features are
being considered for adoption, in addition to what past experiments
have already decided.

* jc/document-test-balloons-in-flight:
  CodingGuidelines: document test balloons in flight
</content>
</entry>
<entry>
<title>CodingGuidelines: clarify that S_release() does not reinitialize</title>
<updated>2025-08-01T17:08:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-01T17:06:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ac3302a1a77cf833fc7085a0b6a6b49024d1bc5'/>
<id>urn:sha1:4ac3302a1a77cf833fc7085a0b6a6b49024d1bc5</id>
<content type='text'>
In the section for naming various API functions, the fact that
S_release() only releases the resources without preparing the
structure for immediate reuse becomes only apparent when you
readentries for S_release() and S_clear().

Clarify the description of S_release() a bit to make the entry self
sufficient.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pw/adopt-c99-bool-officially'</title>
<updated>2025-07-24T23:03:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-07-24T23:03:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ce97021dd22751d0ab66dce4106dabc0463cdf0'/>
<id>urn:sha1:5ce97021dd22751d0ab66dce4106dabc0463cdf0</id>
<content type='text'>
Declare weather-balloon we raised for "bool" type 18 months ago a
success and officially allow using the type in our codebase.

* pw/adopt-c99-bool-officially:
  strbuf: convert predicates to return bool
  git-compat-util: convert string predicates to return bool
  CodingGuidelines: allow the use of bool
</content>
</entry>
<entry>
<title>CodingGuidelines: document test balloons in flight</title>
<updated>2025-07-24T16:23:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-07-23T19:31:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9b2527caa4886dd9c7a1e4fb943f7c6484542c45'/>
<id>urn:sha1:9b2527caa4886dd9c7a1e4fb943f7c6484542c45</id>
<content type='text'>
Due to portability concerns, we do not blindly say "It is in [[this
standard]], so we will make liberal use of it" for many features,
and use of C99 language features follow this same principle.  When
we contemplate adopting a language feature that we haven't used in
our codebase, we typically first raise a test balloon, which

 - is a piece of code that exercises the language feature we are
   trying to see if it is OK to adopt

 - is in a small section of code that we know everybody who cares
   about having a working Git must be compiling

 - is in a fairly stable part of the code, to allow reverting it
   easily if some platforms do not understand it yet.

After a few years, with no breakage report from the community, we'd
declare that the feature is now safe to use in our codebase.  Before
that, we forbid the use of the language construct except for the
designated test balloon code site.

The CodingGuidelines document lists these selected features that we
already have determined that they are safe, and also those features
that we know some platforms had trouble with.

Let's also start listing ongoing test balloons and expected timeline
for adoption.  Recently phillip proposed to adopt the syntax to
spell a structure literally (i.e. compound literal) with a new test
balloon, which Patrick made redundant by pointing out an existing
one we had already.but without documenting it.  Start the new section
with an entry for that test balloon.

Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Helped-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: allow the use of bool</title>
<updated>2025-07-16T15:18:05Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2025-07-16T09:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bfa405ea36b1d3dd9bb3999a6a5590c15af13fae'/>
<id>urn:sha1:bfa405ea36b1d3dd9bb3999a6a5590c15af13fae</id>
<content type='text'>
We have had a test balloon for C99's bool type since 8277dbe987
(git-compat-util: convert skip_{prefix,suffix}{,_mem} to bool,
2023-12-16). As we've had it over 18 months without any complaints
let's declare it a success.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/cg-let-bss-do-its-job'</title>
<updated>2025-06-24T16:48:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-06-24T16:48:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1f082506ba5b9815a6d7476aca40880c08950fef'/>
<id>urn:sha1:1f082506ba5b9815a6d7476aca40880c08950fef</id>
<content type='text'>
Clarify "do not explicitly initialize to zero" rule in the
CodingGuidelines document.

* jc/cg-let-bss-do-its-job:
  CodingGuidelines: let BSS do its job
</content>
</entry>
<entry>
<title>Merge branch 'cf/guideline-documenting-config-vars'</title>
<updated>2025-06-18T20:53:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-06-18T20:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1a1d79fcf13c1ab52de01d741767ce42930dbf4'/>
<id>urn:sha1:f1a1d79fcf13c1ab52de01d741767ce42930dbf4</id>
<content type='text'>
CodingGuidelines update.

* cf/guideline-documenting-config-vars:
  CodingGuidelines: document formatting of similar config variables.
</content>
</entry>
<entry>
<title>CodingGuidelines: document formatting of similar config variables.</title>
<updated>2025-06-18T20:48:11Z</updated>
<author>
<name>Collin Funk</name>
<email>collin.funk1@gmail.com</email>
</author>
<published>2025-06-03T22:45:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff67eea529b450293b19182386b48d317895a414'/>
<id>urn:sha1:ff67eea529b450293b19182386b48d317895a414</id>
<content type='text'>
Document that related `git config` variables should be placed
one-per-line instead of separated by commas.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Collin Funk &lt;collin.funk1@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
