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

Re: [PATCH v2 1/2] for-each-ref: re-structure code for moving to 'ref-filter'

From
Junio C Hamano <gitster@pobox.com>
Date
May 25, 2015, 19:39 UTC
Message-ID
<xmqq617gbg58.fsf@gitster.dls.corp.google.com>
In-Reply-To
<55636301.7060803@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 11 quoted lines
>> I do not see much point in renaming between these two.  The latter
>> makes it sound as if this is only for "filtering" and from that
>> angle of view is probably a worse name.  If you do not think of a
>> better one, and if you are going to name the array that contains
>> this thing "ref_list", calling "ref_list_item" would be following
>> suit to what string-list did.
>>
>
> Well I just wanted to keep it related to 'ref-filter', I think
> 'ref_list_item'
> sounds better after seeing your point of view.

Also I think Matthieu already commented that "filter" was out of place for that struct. I still think your ref_list is better called ref_array, but that is a minor point. Use of "foo_list" in our codebase is predominantly (because we use "commit_list" very often in the core part of the system) for a linear linked list where you do not have a random access to the items. string-list is misnomer, I would think.

> I didn't know about the "we are trying to move away from calling the
> name of objects as "sha1[]"". Will leave it as objectname then.
I think you now know after seeing that 56-patch series ;-)
Show 7 quoted lines
>> You didn't explain why you reordered the fields, either.  Were you
>> planning to make the name[] field to flex-array to reduce need for
>> one level of redirection or something?
>>
>
> Yes! exactly why the re-order, was going to rebase it and squash it
> in, if the code seemed to be up and running.

If that is the case, I would suggest making that "turn it flex array" a separate step.

Previous: Karthik NayakNext: Karthik Nayak
Message 5 of 10 in “Ref-filter: unification of 'tag -l', 'branch -l' and 'for-each-ref'”
  1. Karthik NayakMay 25, 2015
  2. 1/2 for-each-ref: re-structure code for moving to 'ref-filter'Karthik Nayak, May 25, 2015
  3. Junio C HamanoMay 25, 2015
  4. Karthik NayakMay 25, 2015
  5. Junio C HamanoMay 25, 2015
  6. Karthik NayakMay 26, 2015
  7. Matthieu MoyMay 26, 2015
  8. Karthik NayakMay 28, 2015
  9. Matthieu MoyMay 28, 2015
  10. 2/2 ref-filter: move code from 'for-each-ref'Karthik Nayak, May 25, 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.