Re: [PATCH v3 08/15] ref-filter: introduce color_atom_parser()
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jan 6, 2016, 10:16 UTC
- Message-ID
- <CAOLa=ZRaviYJNmnq0jucBdQLZrDKr7xNR30k3jP_j_n9UCJ91Q@mail.gmail.com>
- In-Reply-To
- <xmqqr3hvivml.fsf@gitster.mtv.corp.google.com>
On Wed, Jan 6, 2016 at 2:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> @@ -90,7 +105,7 @@ static struct {
>> { "symref" },
>> { "flag" },
>> { "HEAD" },
>> - { "color" },
>> + { "color", FIELD_STR, color_atom_parser },
>> { "align" },
>> { "end" },
>> };
>
> This is minor, as I do not think anybody sane would say
> "for-each-ref --sort=color" and expect anything sensible, but
>I completely understand and the only reason that I added FIELD_STR cause that was the default either ways.
Show 16 quoted lines
> I think we shouldn't mark these bogus attributes [*1*] as FIELD_STR > (and it is not FIELD_ULONG, either). Perhaps add a new FIELD_BOGUS > (or some better name to make it clear that this is not a "value" > that belongs to the ref and can be used to sort, e.g. "FAKE") value > and mark them as such? > > That would allow us to error out when they are specified as a > sorting criteria. > > > [Footnote] > > *1* Bogus from the point of view of "what are the various attributes > specific to these items that the command is iterating over, > i.e. refs (or the objects at the tips of these refs)", as color, > align, etc. are not attributes per refs.
I'm sure something like FIELD_BOGUS would make a lot of sense, but I wont include that into this series. Maybe after this?
-- Regards, Karthik Nayak