Skip to content

Commit

Permalink
help.c: add a compatibility comment to cmd_version()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
David Aguilar authored and Junio C Hamano committed Apr 16, 2013
1 parent a46221e commit f2de0b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions help.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit f2de0b9

Please sign in to comment.