From: Brian Gernhardt Date: Fri, 18 Sep 2009 04:43:47 GMT Subject: Re: Add compiled date to git --version output? Message-ID: In-Reply-To: <544dda350909172117r44761577m11e7d30a1a5d0c91@mail.gmail.com> On Sep 18, 2009, at 12:17 AM, Nazri Ramliy wrote: > + printf("git version %s compiled %s %s\n", > + git_version_string, > + __DATE__, > + __TIME__); > Thoughts? Any idea how compatible that is? Sure, it'll work with GCC's cpp, but we try to work with a huge variety of compilers. At the very least you might want to wrap it all in #ifdefs or something: #if defined(__DATE__) && defined(__TIME__) /* your version */ #else /* old version */ #endif (Or play fun tricks with #ifndef ... #define, but then you also have to play with the format string or something.) ~~Brian