Re: [PATCH v2 2/2] [GSOC] ref-filter: add %(raw) atom
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Jun 1, 2021, 11:05 UTC
- Message-ID
- <CAOLTT8TP0kxp=MJw_kBifWjf9n69FWS8Mcxn0EZjsM69MdidHw@mail.gmail.com>
- In-Reply-To
- <xmqqa6o9ucyc.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2021年6月1日周二 下午5:54写道:
Show 8 quoted lines
> > > Well, there seems to be no correction here. But is it true that memory > > like "\0abc" is considered empty? > > That sample has 'a' or 'b' or 'c' that are clearly not part of an > "empty" string and irrelevant. After all, a string " abc" is not > treated as empty in the original implementation, either. >
In other words, we still need to look at each character of strbuf, instead of stopping at NUL.
> You are treating a block of memory with e.g. " \000 " (SP NUL SP) as > an "empty line" just like you do for " " (SP SP SP), but I think we > should treat it more like " \001 " or " \007 ", i.e. not an empty > string at all.
OK. I understand it now: " \001 " is It’s like a block of space, but it’s not truly "empty", "SP NUL SP" is same too, So the complete definition of "empty" here should be: All characters are SP which do not contain NUL or other characters.
Thanks. -- ZheNing Hu