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

Re: MinGW port - initial work uploaded

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 22, 2007, 16:39 UTC
Message-ID
<Pine.LNX.4.64.0701220823260.32200@woody.linux-foundation.org>
In-Reply-To
<46d6db660701220506t20214d3bi4d0e1e93abd01aad@mail.gmail.com>
On Mon, 22 Jan 2007, Christian MICHON wrote:
> 
> One problem I haven't found a solution for though: the date
> of commit is wrong, always back to epoch (1970???).
Without knowing MinGW, I'd assume it's one of two issues:
 - parse_date will probably do this when the date is empty. The way git 
   works, is it takes the date from the GIT_COMMITTER|AUTHOR_DATE 
   environment variables, and it depends on getenv() returning NULL if 
   that environment variable isn't set.
   Maybe getenv() under MinGW always returns a real string, and it's just 
   empty? If so, get_ident() should probably be changed from doing
	if (date_str)
		parse_date(...)
   to
	if (date_str && *date_str)
		parse_date(...)
   or something like that.
 - datestamp() uses "time()" to get the number of seconds since the epoch. 
   HOWEVER, it does it by actually doing
	time_t now;
	time(&now);
   which is proper, but maybe a bit unusual. Try changing that to
	now = time(NULL);
   and see if that changes behaviour (it's datestamp() in date.c).
   Alternatively, if "time()" just doesn't work in MinGW, just use 
   gettimeofday() instead, something like
	time_t now;
	int offset;
	struct timeval tv;
	struct timezone tz;
	/* Just in case not everybody necessarily fills in TZ correctly.. */
	memset(&tz, 0, sizeof(tz));
	gettimeofday(&tv, &tz);
	now = tv.tv_sec;
	offset = tz.tz_minuteswest;
   instead of the current mess with localtime() and company.
   [ NOTE NOTE NOTE! The above gettimeofday() thing has NOT been tested. 
     Using the "tz" value to gettimeofday() is generally considered a bug, 
     and shouldn't really be done. It's very traditional (read: 
     old-fashioned) and very incorrect (it will ignore the TZ variable, 
     and ask the kernel, which generally has no clue at all about 
     timezones). But maybe it works on MinGW, so it might be worth 
     testing. ]

Anyway. I have no idea of Windows or MinGW, or what you did to make it all compile, so..

		Linus
Previous: Christian MICHONNext: Christian MICHON
Message 9 of 53 in “MinGW port - initial work uploaded”
  1. Johannes SixtJan 19, 2007
  2. Christian MICHONJan 19, 2007
  3. MichaelJan 19, 2007
  4. Shawn O. PearceJan 20, 2007
  5. Johannes SchindelinJan 20, 2007
  6. Johannes SixtJan 20, 2007
  7. Christian MICHONJan 20, 2007
  8. Christian MICHONJan 22, 2007
  9. Linus TorvaldsJan 22, 2007
  10. Christian MICHONJan 22, 2007
  11. H. Peter AnvinFeb 8, 2007
  12. Christian MICHONFeb 8, 2007
  13. H. Peter AnvinFeb 8, 2007
  14. Johannes SchindelinJan 23, 2007
  15. Christian MICHONJan 23, 2007
  16. Johannes SchindelinJan 23, 2007
  17. Linus TorvaldsJan 23, 2007
  18. Alex RiesenJan 23, 2007
  19. Johannes SchindelinJan 23, 2007
  20. Alex RiesenJan 23, 2007
  21. Johannes SchindelinJan 23, 2007
  22. Shawn O. PearceJan 23, 2007
  23. Johannes SchindelinJan 23, 2007
  24. Nguyen Thai Ngoc DuyJan 24, 2007
  25. Johannes SchindelinJan 24, 2007
  26. Linus TorvaldsJan 24, 2007
  27. Christian MICHONJan 24, 2007
  28. H. Peter AnvinFeb 8, 2007
  29. Johannes SixtJan 22, 2007
  30. Christian MICHONJan 22, 2007
  31. Christian MICHONJan 23, 2007
  32. Johannes SchindelinJan 23, 2007
  33. Jakub NarebskiJan 23, 2007
  34. Shawn O. PearceJan 23, 2007
  35. Christian MICHONJan 23, 2007
  36. Johannes SchindelinJan 23, 2007
  37. Christian MICHONJan 23, 2007
  38. Johannes SchindelinJan 23, 2007
  39. Johannes SchindelinJan 23, 2007
  40. Andy ParkinsJan 23, 2007
  41. Johannes SchindelinJan 23, 2007
  42. Andy ParkinsJan 23, 2007
  43. Johannes SchindelinJan 23, 2007
  44. Andy ParkinsJan 23, 2007
  45. Johannes SchindelinJan 23, 2007
  46. Linus TorvaldsJan 23, 2007
  47. Johannes SchindelinJan 23, 2007
  48. Junio C HamanoJan 24, 2007
  49. Johannes SchindelinJan 24, 2007
  50. Junio C HamanoJan 24, 2007
  51. Johannes SchindelinJan 24, 2007
  52. Nguyen Thai Ngoc DuyJan 23, 2007
  53. Johannes SchindelinJan 23, 2007

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.