[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgit
Subject:    Re: [PATCH 12/16] Display notes from namespace
From:       Richard <richard.maw () gmail ! com>
Date:       2016-07-29 15:56:57
Message-ID: CAB2VqoZgwOcGMwDE8k-BAxLv9K3L5zhvUyVPnb3qq6JwdXS41g () mail ! gmail ! com
[Download RAW message or body]

On 29 July 2016 at 15:44, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> On Sat, Jul 16, 2016 at 12:59 AM, Richard Maw <richard.maw@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.
_______________________________________________
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic