git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Philip Oakley <philipoakley@iee.org>
Subject: [PATCH] help.c: add a compatibility comment to cmd_version()
Date: Tue, 16 Apr 2013 13:33:25 -0700	[thread overview]
Message-ID: <1366144405-61438-1-git-send-email-davvid@gmail.com> (raw)

External projects have been known to parse the output of
"git version".  Help prevent future authors from changing
its format by adding a comment to its implementation.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 help.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/help.c b/help.c
index 1dfa0b0..02ba043 100644
--- a/help.c
+++ b/help.c
@@ -397,6 +397,10 @@ const char *help_unknown_cmd(const char *cmd)
 
 int cmd_version(int argc, const char **argv, const char *prefix)
 {
+	/*
+	 * The format of this string should be kept stable for compatibility
+	 * with external projects that rely on the output of "git version".
+	 */
 	printf("git version %s\n", git_version_string);
 	return 0;
 }
-- 
1.8.2.1.652.ge104b5e

             reply	other threads:[~2013-04-16 20:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 20:33 David Aguilar [this message]
2013-04-16 20:46 ` [PATCH] help.c: add a compatibility comment to cmd_version() Junio C Hamano
2013-04-16 21:59 ` Philip Oakley
2013-04-16 22:35   ` Junio C Hamano
2013-04-17 23:03     ` Philip Oakley
2013-04-18  0:13       ` Junio C Hamano
2013-04-18 23:00         ` Philip Oakley

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=1366144405-61438-1-git-send-email-davvid@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=philipoakley@iee.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).