git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] help.c: Pull cmd_version out of this file.

From
Thiago Farina <tfransosi@gmail.com>
Date
Aug 29, 2010, 20:44 UTC
Message-ID
<2ae543604216146b742253584d8393c5e3179697.1283114573.git.tfransosi@gmail.com>

Promote cmd_version to a builtin, by moving it to its own file in builtin/version.c

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
 Makefile          |    1 +
 builtin/version.c |    7 +++++++
 help.c            |    6 ------
 3 files changed, 8 insertions(+), 6 deletions(-)
 create mode 100644 builtin/version.c
diff --git a/Makefile b/Makefile
index b4745a5..0f3b6d8 100644
--- a/Makefile
+++ b/Makefile
@@ -738,6 +738,7 @@ BUILTIN_OBJS += builtin/upload-archive.o
 BUILTIN_OBJS += builtin/var.o
 BUILTIN_OBJS += builtin/verify-pack.o
 BUILTIN_OBJS += builtin/verify-tag.o
+BUILTIN_OBJS += builtin/version.o
 BUILTIN_OBJS += builtin/write-tree.o
 
 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
diff --git a/builtin/version.c b/builtin/version.c
new file mode 100644
index 0000000..d98e260
--- /dev/null
+++ b/builtin/version.c
@@ -0,0 +1,7 @@
+#include "builtin.h"
+
+int cmd_version(int argc, const char **argv, const char *prefix)
+{
+	printf("git version %s\n", git_version_string);
+	return 0;
+}
diff --git a/help.c b/help.c
index 7f4928e..ad4f923 100644
--- a/help.c
+++ b/help.c
@@ -362,9 +362,3 @@ const char *help_unknown_cmd(const char *cmd)
 
 	exit(1);
 }
-
-int cmd_version(int argc, const char **argv, const char *prefix)
-{
-	printf("git version %s\n", git_version_string);
-	return 0;
-}
-- 
1.7.2.1.95.g3d045
Next: Jonathan Nieder
Message 1 of 18 in “help.c: Pull cmd_version out of this file.”
  1. help.c: Pull cmd_version out of this file.Thiago Farina, Aug 29, 2010
  2. Jonathan NiederAug 30, 2010
  3. Jonathan NiederAug 30, 2010
  4. Thiago FarinaSep 1, 2010
  5. Nguyen Thai Ngoc DuySep 1, 2010
  6. Thiago FarinaSep 1, 2010
  7. Junio C HamanoSep 1, 2010
  8. Thiago FarinaSep 1, 2010
  9. Junio C HamanoSep 2, 2010
  10. Thiago FarinaSep 2, 2010
  11. Jonathan NiederSep 2, 2010
  12. Junio C HamanoSep 2, 2010
  13. Thiago FarinaOct 27, 2010
  14. Jonathan NiederOct 27, 2010
  15. Thiago FarinaOct 27, 2010
  16. Jonathan NiederOct 27, 2010
  17. Thiago FarinaOct 28, 2010
  18. Jonathan NiederOct 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.