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

Re: [RFC] struct *_struct

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 4, 2010, 19:24 UTC
Message-ID
<7vaap2fafm.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100804150843.GA2762@localhost.localdomain>
Jared Hance <jaredhance@gmail.com> writes:
>     - We use this style in only 3 cases

I think they were early-days inertia between me and Linus. I hate "struct foo_struct" (and "typedef foo struct foo") myself and that is why we don't see many others.

I am personally Ok if you want to give them more sensible names. Doing s/_struct$// is a no-brainer for "diff_queue_struct", but I do not think doing that alone would be a good idea for "cmd_struct" and "dir_struct".

I'd suggest calling the former "cmd_desc", as it is a set of info on a single command. "dir_struct" is a table that records a set of paths in the whole work tree and it is not about a single directory (nor a single entry in that table, which is "dir_entry"); as such "dir" that sounds too similar to DIR that is what opendir() returns (i.e. a single directory) may probably not be a good name for it.

Previous: Jared HanceNext: Jared Hance
Message 2 of 8 in “[RFC] struct *_struct”
  1. Jared HanceAug 4, 2010
  2. Junio C HamanoAug 4, 2010
  3. Refactor structures in the form of *_struct.Jared Hance, Aug 4, 2010
  4. Michael WittenAug 5, 2010
  5. Jared HanceAug 5, 2010
  6. Michael WittenAug 6, 2010
  7. Jared HanceAug 6, 2010
  8. Miles BaderAug 6, 2010

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.