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

Re: [PATCH 2/2 v4] tag: support configuring --sort via .gitconfig

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 11, 2014, 16:28 UTC
Message-ID
<xmqqtx6n507e.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1405095622.22963.6.camel@jekeller-desk1.amr.corp.intel.com>
"Keller, Jacob E" <jacob.e.keller@intel.com> writes:
Show 13 quoted lines
> On Fri, 2014-07-11 at 08:04 -0700, Junio C Hamano wrote:
> ...
>> > +static int tag_sort = 0;
>> 
>> Please do not initialize variables in bss segment to 0 by hand.
>> 
>> If this variable is meant to take one of these *CMP_SORT values
>> defined as macro later in this file, it is better to define this
>> variable somewhere after and close to the definitions of the macros.
>> Perhaps immediately after the "struct tag_filter" is declared?
>
> I put it just above the struct tag_filter now, as this puts it right
> below the #defines regarding it's value.
Either would be fine, but just to clarify.

Because these macro definitions are for the .sort field of that structure, and the new tag_sort variable is the second user of that macro, my suggestion to put it _after_ was to be in line with "add new things at the end, when there is no compelling reason not to" below.

Show 5 quoted lines
>> When there is no reason to have things in a particular order, it is
>> customary to add new things at the end, not in the front, unless the
>> new thing is so much more important than everything else---but then
>> we are no longer talking about the case where there is no reason to
>> have things in a particular order ;-).
Thanks.
Previous: Keller, Jacob ENext: Keller, Jacob E
Message 5 of 10 in “tag: use skip_prefix instead of magic numbers”
  1. 1/2 tag: use skip_prefix instead of magic numbersJacob Keller, Jul 10, 2014
  2. 2/2 tag: support configuring --sort via .gitconfigJacob Keller, Jul 10, 2014
  3. Junio C HamanoJul 11, 2014
  4. Keller, Jacob EJul 11, 2014
  5. Junio C HamanoJul 11, 2014
  6. Keller, Jacob EJul 11, 2014
  7. Junio C HamanoJul 11, 2014
  8. Keller, Jacob EJul 11, 2014
  9. Keller, Jacob EJul 11, 2014
  10. Duy NguyenJul 16, 2014

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.