git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Andreas Ericsson <ae@op5.se>
Date
Nov 1, 2006, 08:25 UTC
Message-ID
<45485A0F.3040807@op5.se>
In-Reply-To
<200610282323.57797.jnareb@gmail.com>
Jakub Narebski wrote:
Show 24 quoted lines
> 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@op5.se
OP5 AB                             www.op5.se
Previous: Jakub NarebskiNext: Junio C Hamano
Message 4 of 15 in “Documentation: Update information about <format> in git-for-each-ref”
  1. Documentation: Update information about <format> in git-for-each-refJakub Narebski, Oct 28, 2006
  2. Junio C HamanoOct 28, 2006
  3. Jakub NarebskiOct 28, 2006
  4. Andreas EricssonNov 1, 2006
  5. Junio C HamanoNov 1, 2006
  6. Andreas EricssonNov 1, 2006
  7. Junio C HamanoNov 1, 2006
  8. Johannes SchindelinNov 1, 2006
  9. 1/2 for-each-ref: "creator" and "creatordate" fieldsJakub Narebski, Nov 2, 2006
  10. 2/2 gitweb: Use git-for-each-ref to generate list of heads and/or tagsJakub Narebski, Nov 2, 2006
  11. Junio C HamanoNov 3, 2006
  12. Jakub NarebskiNov 3, 2006
  13. Junio C HamanoNov 3, 2006
  14. Jakub NarebskiNov 3, 2006
  15. Junio C HamanoOct 28, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.