Skip to content

Commit f2de0b9

Browse files
davvidgitster
authored andcommitted
help.c: add a compatibility comment to cmd_version()
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a46221e commit f2de0b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

help.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ const char *help_unknown_cmd(const char *cmd)
397397

398398
int cmd_version(int argc, const char **argv, const char *prefix)
399399
{
400+
/*
401+
* The format of this string should be kept stable for compatibility
402+
* with external projects that rely on the output of "git version".
403+
*/
400404
printf("git version %s\n", git_version_string);
401405
return 0;
402406
}

0 commit comments

Comments
 (0)