From mboxrd@z Thu Jan 1 00:00:00 1970 From: richard.maw at gmail.com (Richard) Date: Fri, 29 Jul 2016 16:56:57 +0100 Subject: [PATCH 12/16] Display notes from namespace In-Reply-To: References: <20160715230002.29547-1-richard.maw@gmail.com> <20160715230002.29547-13-richard.maw@gmail.com> Message-ID: On 29 July 2016 at 15:44, Jason A. Donenfeld wrote: > On Sat, Jul 16, 2016 at 12:59 AM, Richard Maw 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.