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

Re: [PATCH 00/12] c99: use more designated initializers

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 24, 2022, 22:43 UTC
Message-ID
<220224.86y21z98zr.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqsfs8kpm4.fsf@gitster.g>
On Thu, Feb 24 2022, Junio C Hamano wrote:
Show 24 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> This is probably a bit premature given that we still are treating the
>> C99-isms as weather balloons. The idea was to keep things in an
>> easily-revertable state for at least a couple of major versions.
>>
>> The referenced changes are only in core Git as of v2.34.0, and we are not
>> even half-way through the v2.36.0 cycle.
>
> The proposed commit log messages need updating.  By refering to much
> newer commits created by the same author, instead of the beginning
> of the official weather balloon experiments, it created an unnecessary
> confusion.
>
> Read the CodingGuidelines document.  Everybody knows what it says by
> heart by now, right? ;-)
>
>    . since mid 2017 with cbc0f81d, we have been using designated
>      initializers for struct (e.g. "struct t v = { .val = 'a' };").
>
>    . since mid 2017 with 512f41cf, we have been using designated
>      initializers for array (e.g. "int array[10] = { [5] = 2 }").
>
> I do not think doing this in early 2022 is still premature.

It's hard sometimes to anticipate what'll be the best reference. I figured linking to similar recent tree-wide changes would make it easier for reviewers to shortcut to "oh, we had similar tree-wide changes recently, so this is OK too".

As opposed to referencing the initial forays into designated initializers, which wouldn't provide the same overview of how tree-wide this pattern already is at a glance.

But sure, I can mention that more prominently/discuss both.
> I hate to having to deal with such a tree-wide churn, though.  I'd
> rather see "let's do this only on quiescent part of the tree a small
> bit at a time" like on imap-send.c but not involving anything known
> to be actively touched, like ref backends.

While these are tree-wide, I don't think you'll have any trouble with them, including the ones touching the refs backend.

We're anticipating the final bits of the reftable integration, which will add another declaration like the one in 2/12, but that won't conflict with these modifications of the existing assignment.

Of course such a change might also want to use designated initializers to match, but that would have been a good idea anyway for new code regardless of whether this series got merged or not.

Previous: Junio C HamanoNext: Junio C Hamano
Message 16 of 17 in “c99: use more designated initializers”
  1. 00/12 c99: use more designated initializersÆvar Arnfjörð Bjarmason, Feb 24, 2022
  2. 01/12 imap-send.c: use designated initializers for "struct imap_server_conf"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  3. 02/12 refs: use designated initializers for "struct ref_storage_be"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  4. 03/12 refs: use designated initializers for "struct ref_iterator_vtable"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  5. 04/12 trace2: use designated initializers for "struct tr2_tgt"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  6. 05/12 trace2: use designated initializers for "struct tr2_dst"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  7. 06/12 object-file: use designated initializers for "struct git_hash_algo"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  8. 07/12 archive-*.c: use designated initializers for "struct archiver"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  9. 08/12 userdiff.c: use designated initializers for "struct userdiff_driver"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  10. 09/12 convert.c: use designated initializers for "struct stream_filter*"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  11. 10/12 refspec.c: use designated initializers for "struct refspec_item"Ævar Arnfjörð Bjarmason, Feb 24, 2022
  12. 11/12 misc *.c: use designated initializers for struct assignmentsÆvar Arnfjörð Bjarmason, Feb 24, 2022
  13. 12/12 misc *.c: use designated initializers for "partial" struct assignmentsÆvar Arnfjörð Bjarmason, Feb 24, 2022
  14. Johannes SchindelinFeb 24, 2022
  15. Junio C HamanoFeb 24, 2022
  16. Ævar Arnfjörð BjarmasonFeb 24, 2022
  17. Junio C HamanoFeb 25, 2022

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.