[PATCH 12/16] Display notes from namespace

Jason A. Donenfeld Jason at zx2c4.com
Fri Jul 29 16:44:38 CEST 2016


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? Why are the extra refs globs
exactly? Does git core have a convenience function for this?

> +                               }
> +                               string_list_append(&opt.extra_notes_refs, glob_escaped.buf);
> +                       } else {
> +                               string_list_append(&opt.extra_notes_refs, namespaced_note_ref.buf);
> +                       }

else
        single-statement;


> +               }
> +
> +               init_display_notes(&opt);
> +               string_list_clear(&opt.extra_notes_refs, 1);
> +               strbuf_release(&glob_escaped);
> +               strbuf_release(&namespaced_note_ref);
> +       } else {
> +               init_display_notes(NULL);
> +       }

else
        init_display_notes(NULL);


More information about the CGit mailing list