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

Re: orthogonal cases of log --date option

From
Jeff King <peff@peff.net>
Date
Mar 6, 2009, 12:12 UTC
Message-ID
<20090306121258.GC3437@sigill.intra.peff.net>
In-Reply-To
<7vk573t4cm.fsf@gitster.siamese.dyndns.org>
On Fri, Mar 06, 2009 at 12:58:33AM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> Jay Soffian <jaysoffian@gmail.com> writes:
> 
> > Yeah, that part is easy. I wasn't sure the best way to handle places
> > where a constant date_mode is used e.g.:
> >
> > pp_user_info(NULL, CMIT_FMT_EMAIL, &sb, committer, DATE_RFC2822,
> > 		     encoding);
> 
> One approach that will be hated by libgit2 effort would be to keep the
> date_mode an enum as before (sans DATE_LOCAL) and make the "tz_offset"
> thing as a setting global to the process, defined in environ.c

I haven't looked, but might it not be possible to put it in the rev_info struct next to the date format, but not as part of a struct? You will then sometimes have to pass two options around (the format and the tz offset) instead of one (the struct with both), but it makes split usage much easier:

  pp_user_info(NULL, CMIT_FMT_EMAIL, &sb, committer, DATE_RFC2822,
               revs->tz_offset, encoding);
-Peff
Previous: Junio C HamanoNext: Jeff King
Message 14 of 17 in “orthogonal cases of log --date option”
  1. Miles BaderMar 3, 2009
  2. Jeff KingMar 3, 2009
  3. Junio C HamanoMar 3, 2009
  4. Jeff KingMar 5, 2009
  5. Jay SoffianMar 5, 2009
  6. Jeff KingMar 5, 2009
  7. Junio C HamanoMar 5, 2009
  8. Jeff KingMar 6, 2009
  9. Junio C HamanoMar 6, 2009
  10. Jay SoffianMar 6, 2009
  11. Junio C HamanoMar 6, 2009
  12. Jay SoffianMar 6, 2009
  13. Junio C HamanoMar 6, 2009
  14. Jeff KingMar 6, 2009
  15. Jeff KingMar 6, 2009
  16. Jeff KingMar 6, 2009
  17. Miles BaderMar 6, 2009

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.