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

Re: cmd_struct

From
Junio C Hamano <gitster@pobox.com>
Date
May 13, 2015, 23:31 UTC
Message-ID
<xmqq617w9hr1.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPc5daUF1SaCOqb0iEZ527q-CgQn3YyMSWufOsQx9Lo1+aUBrg@mail.gmail.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> On Wed, May 13, 2015 at 4:10 PM, Thiago Farina <tfransosi@gmail.com> wrote:
>>
>> Would be too churn/noise (at this point) to rename cmd_struct to builtin_cmd?
>
> The name has served us well, I do not see a compelling reason to change it
> to anything else, and I suspect the name stayed unchanged because nobody
> else found such a reason, either.
>
> So... if you are unwilling to make a compelling case telling us why the current
> name does not work, I do not think it is likely that anybody finds such a change
> necessary, welcome, or even tolerable.

Having said that, I would agree that if I were writing git.c from scratch today, I would have done

	static struct builtin_cmd builtin_cmd[] = { ...
insead of the current
	static struct cmd_struct commands[] = { ...

just because I think it makes more sense. But that reason suggests it is a mere code churn of no value, after all these years.

"Because the non-POSIX non-ANSI-C platform I am porting for stomps on the end-user program's namespace, and cmd_struct is one of the victims" could be a reason that is better than "just because I think it makes more sense", but even then, there would probably be a better ways other than renaming the symbols in end-user code (i.e. Git) to solve such a name clash.

Previous: Junio C HamanoNext: Johannes Schindelin
Message 4 of 5 in “cmd_struct”
  1. Thiago FarinaMay 13, 2015
  2. Jonathan NiederMay 13, 2015
  3. Junio C HamanoMay 13, 2015
  4. Junio C HamanoMay 13, 2015
  5. Johannes SchindelinMay 14, 2015

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.