Re: [PATCH v17 05/14] ref-filter: introduce match_atom_name()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 10, 2015, 17:28 UTC
- Message-ID
- <xmqqlhce420b.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAOLa=ZQM77+EzbHbY24nvu=hgNCa9MJ3wyz1XhFjk+3HdDd_Hg@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> The check was for checking if there is anything after the colon,
Why do you even care? If %(color) expects more specific customization by adding colon followed by specific data after it, i.e. %(color:something), %(color:) should clearly be that "%(color)" thing with no customization---if it is "not enough customization" or "leaving everything default" depends on each atom, match_atom_name() is not a good place to make that policy decision (i.e. Mattheiu's rewrite to clear *valp to NULL when %(color:) is seen). Instead, point *val to body + 1 just as usual, and let the caller tell between *val being NULL (not even any colon) and *val pointing at a NUL byte (nothing after colon) if it cares.