git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Add compiled date to git --version output?
@ 2009-09-18  4:17 Nazri Ramliy
  2009-09-18  4:43 ` Brian Gernhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nazri Ramliy @ 2009-09-18  4:17 UTC (permalink / raw)
  To: git

Sometimes I wanted to know how outdated git is on my system.

Coming up with a script to parse "git --version" output to get the SHA1,
and compare that to master's SHA1 seemed a little overkill compared to
this:

diff --git a/help.c b/help.c
index 294337e..bc83491 100644
--- a/help.c
+++ b/help.c
@@ -361,6 +361,9 @@ const char *help_unknown_cmd(const char *cmd)

 int cmd_version(int argc, const char **argv, const char *prefix)
 {
-       printf("git version %s\n", git_version_string);
+       printf("git version %s compiled %s %s\n",
+                       git_version_string,
+                       __DATE__,
+                       __TIME__);
        return 0;
 }

With this, git --version gives:

        git version 1.6.5.rc1.19.g8426.dirty compiled Sep 18 2009 12:03:29

Thoughts?

Nazri

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-18  6:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18  4:17 Add compiled date to git --version output? Nazri Ramliy
2009-09-18  4:43 ` Brian Gernhardt
2009-09-18  5:03 ` David Aguilar
2009-09-18  5:07 ` Junio C Hamano
2009-09-18  6:04   ` Nazri Ramliy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).