From: Junio C Hamano <gitster@pobox.com>
To: Nazri Ramliy <ayiehere@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Add compiled date to git --version output?
Date: Thu, 17 Sep 2009 22:07:47 -0700 [thread overview]
Message-ID: <7v8wgchmcc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <544dda350909172117r44761577m11e7d30a1a5d0c91@mail.gmail.com> (Nazri Ramliy's message of "Fri\, 18 Sep 2009 12\:17\:48 +0800")
Nazri Ramliy <ayiehere@gmail.com> writes:
> 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?
It's open source, so you are welcome to do that to your binary.
Personally, I do not want it. My build scripts depend on the version
string at the end if the output to omit re-building what is already
installed.
Seriously, the version number is useful to track down the bug, and perhaps
your compiler and library versions might be useful to help diagnose build
related errors, but when would that __DATE__/__TIME__ be useful more than
what "ls -l /usr/bin/git" would give you?
next prev parent reply other threads:[~2009-09-18 5:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2009-09-18 6:04 ` Nazri Ramliy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v8wgchmcc.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=ayiehere@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).