@matheusbsbs / matheus-bagliano / commits / 9a0eaf83ea
Fork 0

Make git-describe a builtin.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Shawn O. Pearce committed Jan 10, 2007 at 06:36 UTC 9a0eaf83eab5f53db0ba6a514c4d4cf16e846f30
4 files changed +6 -3
Makefile
+2 -1
@@ -204,7 +204,7 @@ PROGRAMS = \
204 git-update-server-info$X \
205 git-upload-pack$X git-verify-pack$X \
206 git-pack-redundant$X git-var$X \
207 - git-describe$X git-merge-tree$X git-imap-send$X \
207 + git-merge-tree$X git-imap-send$X \
208 git-merge-recursive$X \
209 $(EXTRA_PROGRAMS)
210
@@ -275,6 +275,7 @@ BUILTIN_OBJS = \
275 builtin-check-ref-format.o \
276 builtin-commit-tree.o \
277 builtin-count-objects.o \
278 + builtin-describe.o \
279 builtin-diff.o \
280 builtin-diff-files.o \
281 builtin-diff-index.o \
builtin-describe.c renamed
+2 -2
@@ -2,6 +2,7 @@
2 #include "commit.h"
3 #include "tag.h"
4 #include "refs.h"
5 +#include "builtin.h"
6
7 #define SEEN (1u << 0)
8
@@ -139,7 +140,7 @@ static void describe(const char *arg, int last_one)
140 die("cannot describe '%s'", sha1_to_hex(cmit->object.sha1));
141 }
142
142 -int main(int argc, char **argv)
143 +int cmd_describe(int argc, const char **argv, const char *prefix)
144 {
145 int i;
146
@@ -161,7 +162,6 @@ int main(int argc, char **argv)
162 usage(describe_usage);
163 }
164
164 - setup_git_directory();
165 save_commit_buffer = 0;
166
167 if (argc <= i)
builtin.h
+1
@@ -25,6 +25,7 @@ extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
25 extern int cmd_cherry(int argc, const char **argv, const char *prefix);
26 extern int cmd_commit_tree(int argc, const char **argv, const char *prefix);
27 extern int cmd_count_objects(int argc, const char **argv, const char *prefix);
28 +extern int cmd_describe(int argc, const char **argv, const char *prefix);
29 extern int cmd_diff_files(int argc, const char **argv, const char *prefix);
30 extern int cmd_diff_index(int argc, const char **argv, const char *prefix);
31 extern int cmd_diff(int argc, const char **argv, const char *prefix);
git.c
+1
@@ -220,6 +220,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
220 { "cherry", cmd_cherry, RUN_SETUP },
221 { "commit-tree", cmd_commit_tree, RUN_SETUP },
222 { "count-objects", cmd_count_objects, RUN_SETUP },
223 + { "describe", cmd_describe, RUN_SETUP },
224 { "diff", cmd_diff, RUN_SETUP | USE_PAGER },
225 { "diff-files", cmd_diff_files, RUN_SETUP },
226 { "diff-index", cmd_diff_index, RUN_SETUP },