Re: [PATCH] Documentation: Update information about <format> in git-for-each-ref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Narebski wrote:
Junio C Hamano wrote:
[PATCH] for-each-ref: epoch and epochdate

This adds "epoch" (which is parallel to "tagger" or "committer")
and "epochdate" (corresponds to "taggerdate" and
"committerdate").

As other "date" fields, "epochdate" sorts numerically
and displays human readably

I was thinking about having only "epochdate" (corresponding to either "taggerdate" or "committerdate"), only named "epoch". There is I think no need for field which would be "tagger" or "committer", and especially not named "epoch" ;-).

Otherwise looks fine, thanks a lot.


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. The condition will now be true if the 'who' variable holds a pointer to a string that is either "tagger" or "committer", whereas it used to be true for strings that were anything *but* any of those.

"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. I once ended up doing a macro called "string_matches" just to wrap my head around an insanely long conditional with too many strcmp() with about half of them negated by !.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]