Re: [PATCH] Documentation: Update information about <format> in git-for-each-ref
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 1, 2006, 08:47 UTC
- Message-ID
- <7vd5877duh.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <45485A0F.3040807@op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 13 quoted lines
> Jakub Narebski wrote: > >> BTW. I had to translate >> + if (strcmp(who, "tagger") && strcmp(who, "committer")) >> to >> + if (strcmp(who, "tagger") == 0 || strcmp(who, "committer") == 0) >> to understand it. But this is probably my lack of contact with such >> C idioms. > > But this does the exact opposite.... > "Compare" (as in "strcmp") also translates to "are equal to" and isn't > only a verb. This is unfortunate for people who aren't natively > english and has had me confused on many a long night...
Being a non-English speaker, I always pronounce xxxcmp() used as boolean 'is different' in my head. The (correct version of the) above example expression is read as 'if it is different from "tagger" and it is different from "committer", then do this'.
Otherwise I pronounce xxxcmp(a,b) "difference"; it's sign matches (a-b).
if (xxxcmp(a,b) < 0) is similar to if ((a-b) < 0) which is equivalent to if (a < b).