Re: [PATCH v2] ref-filter.c: pass empty-string as NULL to atom parsers
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 2, 2017, 22:40 UTC
- Message-ID
- <20171002224052.GR19555@aiede.mtv.corp.google.com>
- In-Reply-To
- <20171002161034.44867-1-me@ttaylorr.com>
Hi,
Taylor Blau wrote:
Show 17 quoted lines
> Peff points out that different atom parsers handle the empty > "sub-argument" list differently. An example of this is the format > "%(refname:)". > > Since callers often use `string_list_split` (which splits the empty > string with any delimiter as a 1-ary string_list containing the empty > string), this makes handling empty sub-argument strings non-ergonomic. > > Let's fix this by assuming that atom parser implementations don't care > about distinguishing between the empty string "%(refname:)" and no > sub-arguments "%(refname)". > > Signed-off-by: Taylor Blau <me@ttaylorr.com> > --- > ref-filter.c | 10 +++++++++- > t/t6300-for-each-ref.sh | 1 + > 2 files changed, 10 insertions(+), 1 deletion(-)
The above does a nice job of explaining
- what this change is going to do - how it's good for the internal code structure / maintainability
What it doesn't tell me about is why the user-facing effect won't cause problems. Is there no atom where %(atom:) was previously accepted and did something meaningful that this may break?
Looking at the manpage and code, I don't see any, so for what it's worth, this is
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
but for next time, please remember to discuss regression risk in the commit message, too.
Thanks, Jonathan