Make "git rev-list" be a builtin
This was surprisingly easy. The diff is truly minimal: rename "main()" to "cmd_rev_list()" in rev-list.c, and rename the whole file to reflect its new built-in status. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Linus Torvalds committed
May 18, 2006 at 14:19 UTC
5fb61b8dcfdf7bcec0793c071813e255d1803859
4 files changed
+8
-5
Makefile
+3
-3
@@ -158,7 +158,7 @@ PROGRAMS = \
158
git-ls-files$X git-ls-tree$X git-mailinfo$X git-merge-base$X \
159
git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
160
git-peek-remote$X git-prune-packed$X git-read-tree$X \
161
- git-receive-pack$X git-rev-list$X git-rev-parse$X \
161
+ git-receive-pack$X git-rev-parse$X \
162
git-send-pack$X git-show-branch$X git-shell$X \
163
git-show-index$X git-ssh-fetch$X \
164
git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
@@ -170,7 +170,7 @@ PROGRAMS = \
170
171
BUILT_INS = git-log$X git-whatchanged$X git-show$X \
172
git-count-objects$X git-diff$X git-push$X \
173
- git-grep$X
173
+ git-grep$X git-rev-list$X
174
175
# what 'all' will build and 'install' will install, in gitexecdir
176
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -218,7 +218,7 @@ LIB_OBJS = \
218
219
BUILTIN_OBJS = \
220
builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
221
- builtin-grep.o
221
+ builtin-grep.o builtin-rev-list.o
222
223
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
224
LIBS = $(GITLIBS) -lz
builtin-rev-list.c
renamed
+3
-2
@@ -7,6 +7,7 @@
7
#include "tree-walk.h"
8
#include "diff.h"
9
#include "revision.h"
10
+#include "builtin.h"
11
12
/* bits #0-15 in revision.h */
13
@@ -36,7 +37,7 @@ static const char rev_list_usage[] =
37
" --bisect"
38
;
39
39
-struct rev_info revs;
40
+static struct rev_info revs;
41
42
static int bisect_list = 0;
43
static int show_timestamp = 0;
@@ -291,7 +292,7 @@ static void mark_edges_uninteresting(struct commit_list *list)
292
}
293
}
294
294
-int main(int argc, const char **argv)
295
+int cmd_rev_list(int argc, const char **argv, char **envp)
296
{
297
struct commit_list *list;
298
int i;
builtin.h
+1
@@ -24,5 +24,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp);
24
25
extern int cmd_push(int argc, const char **argv, char **envp);
26
extern int cmd_grep(int argc, const char **argv, char **envp);
27
+extern int cmd_rev_list(int argc, const char **argv, char **envp);
28
29
#endif
git.c
+1
@@ -50,6 +50,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
50
{ "count-objects", cmd_count_objects },
51
{ "diff", cmd_diff },
52
{ "grep", cmd_grep },
53
+ { "rev-list", cmd_rev_list },
54
};
55
int i;
56