зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
065e0b126f
Коммит
5fb61b8dcf
6
Makefile
6
Makefile
|
@ -158,7 +158,7 @@ PROGRAMS = \
|
||||||
git-ls-files$X git-ls-tree$X git-mailinfo$X git-merge-base$X \
|
git-ls-files$X git-ls-tree$X git-mailinfo$X git-merge-base$X \
|
||||||
git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
|
git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
|
||||||
git-peek-remote$X git-prune-packed$X git-read-tree$X \
|
git-peek-remote$X git-prune-packed$X git-read-tree$X \
|
||||||
git-receive-pack$X git-rev-list$X git-rev-parse$X \
|
git-receive-pack$X git-rev-parse$X \
|
||||||
git-send-pack$X git-show-branch$X git-shell$X \
|
git-send-pack$X git-show-branch$X git-shell$X \
|
||||||
git-show-index$X git-ssh-fetch$X \
|
git-show-index$X git-ssh-fetch$X \
|
||||||
git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
|
git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
|
||||||
|
@ -170,7 +170,7 @@ PROGRAMS = \
|
||||||
|
|
||||||
BUILT_INS = git-log$X git-whatchanged$X git-show$X \
|
BUILT_INS = git-log$X git-whatchanged$X git-show$X \
|
||||||
git-count-objects$X git-diff$X git-push$X \
|
git-count-objects$X git-diff$X git-push$X \
|
||||||
git-grep$X
|
git-grep$X git-rev-list$X
|
||||||
|
|
||||||
# what 'all' will build and 'install' will install, in gitexecdir
|
# what 'all' will build and 'install' will install, in gitexecdir
|
||||||
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
|
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
|
||||||
|
@ -218,7 +218,7 @@ LIB_OBJS = \
|
||||||
|
|
||||||
BUILTIN_OBJS = \
|
BUILTIN_OBJS = \
|
||||||
builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
|
builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
|
||||||
builtin-grep.o
|
builtin-grep.o builtin-rev-list.o
|
||||||
|
|
||||||
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
||||||
LIBS = $(GITLIBS) -lz
|
LIBS = $(GITLIBS) -lz
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "tree-walk.h"
|
#include "tree-walk.h"
|
||||||
#include "diff.h"
|
#include "diff.h"
|
||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
|
#include "builtin.h"
|
||||||
|
|
||||||
/* bits #0-15 in revision.h */
|
/* bits #0-15 in revision.h */
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ static const char rev_list_usage[] =
|
||||||
" --bisect"
|
" --bisect"
|
||||||
;
|
;
|
||||||
|
|
||||||
struct rev_info revs;
|
static struct rev_info revs;
|
||||||
|
|
||||||
static int bisect_list = 0;
|
static int bisect_list = 0;
|
||||||
static int show_timestamp = 0;
|
static int show_timestamp = 0;
|
||||||
|
@ -291,7 +292,7 @@ static void mark_edges_uninteresting(struct commit_list *list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int cmd_rev_list(int argc, const char **argv, char **envp)
|
||||||
{
|
{
|
||||||
struct commit_list *list;
|
struct commit_list *list;
|
||||||
int i;
|
int i;
|
|
@ -24,5 +24,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp);
|
||||||
|
|
||||||
extern int cmd_push(int argc, const char **argv, char **envp);
|
extern int cmd_push(int argc, const char **argv, char **envp);
|
||||||
extern int cmd_grep(int argc, const char **argv, char **envp);
|
extern int cmd_grep(int argc, const char **argv, char **envp);
|
||||||
|
extern int cmd_rev_list(int argc, const char **argv, char **envp);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
1
git.c
1
git.c
|
@ -50,6 +50,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
|
||||||
{ "count-objects", cmd_count_objects },
|
{ "count-objects", cmd_count_objects },
|
||||||
{ "diff", cmd_diff },
|
{ "diff", cmd_diff },
|
||||||
{ "grep", cmd_grep },
|
{ "grep", cmd_grep },
|
||||||
|
{ "rev-list", cmd_rev_list },
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче