[PATCH 12/16] Display notes from namespace

Richard richard.maw at gmail.com
Fri Jul 29 17:56:57 CEST 2016


On 29 July 2016 at 15:44, Jason A. Donenfeld <Jason at zx2c4.com> wrote:
> On Sat, Jul 16, 2016 at 12:59 AM, Richard Maw <richard.maw at gmail.com> wrote:
>> +               if (ref_exists(namespaced_note_ref.buf)) {
>> +                       if (has_glob_specials(namespaced_note_ref.buf)) {
>> +                               for (const char *c = namespaced_note_ref.buf; *c; c++) {
>> +                                       if (is_glob_special(*c))
>> +                                               strbuf_addchars(&glob_escaped, '\\', 1);
>> +                                       strbuf_addchars(&glob_escaped, *c, 1);
>
> Could you explain why this is necessary?

The git note loading logic isn't namespace aware,
so rather than reimplementing it all
this just adds the default note file in the current namespace.

> Why are the extra refs globs exactly?

I'm not sure.

I thought it was just that its intended user was glob expressions
provided by the command line or config,
and that it was just a leaky abstraction,
but it looks like there might be validation code preventing refs from
including glob characters.

I'll take a look at the git code to see if I can prove this hypothesis.

> Does git core have a convenience function for this?

Not that I could find, but if my hypothesis proves correct it can go
away entirely.


More information about the CGit mailing list