diff --git a/Makefile b/Makefile
index ad890ec..3439d2c 100644
--- a/Makefile
+++ b/Makefile
@@ -396,7 +396,6 @@ PROGRAMS += git-mktag$X
PROGRAMS += git-pack-redundant$X
PROGRAMS += git-patch-id$X
PROGRAMS += git-shell$X
-PROGRAMS += git-show-index$X
PROGRAMS += git-unpack-file$X
PROGRAMS += git-upload-pack$X
PROGRAMS += git-var$X
@@ -693,6 +692,7 @@ BUILTIN_OBJS += builtin-rm.o
BUILTIN_OBJS += builtin-send-pack.o
BUILTIN_OBJS += builtin-shortlog.o
BUILTIN_OBJS += builtin-show-branch.o
+BUILTIN_OBJS += builtin-show-index.o
BUILTIN_OBJS += builtin-show-ref.o
BUILTIN_OBJS += builtin-stripspace.o
BUILTIN_OBJS += builtin-symbolic-ref.o
diff --git a/show-index.c b/builtin-show-index.c
similarity index 96%
rename from show-index.c
rename to builtin-show-index.c
index 63f9da5..92202b8 100644
--- a/show-index.c
+++ b/builtin-show-index.c
@@ -4,7 +4,7 @@
static const char show_index_usage[] =
"git show-index < <packed archive index>";
-int main(int argc, char **argv)
+int cmd_show_index(int argc, const char **argv, const char *prefix)
{
int i;
unsigned nr;diff --git a/builtin.h b/builtin.h
index c3f83c0..4d73d7c 100644
--- a/builtin.h
+++ b/builtin.h
@@ -93,6 +93,7 @@ extern int cmd_send_pack(int argc, const char **argv, const char *prefix);
extern int cmd_shortlog(int argc, const char **argv, const char *prefix);
extern int cmd_show(int argc, const char **argv, const char *prefix);
extern int cmd_show_branch(int argc, const char **argv, const char *prefix);
+extern int cmd_show_index(int argc, const char **argv, const char *prefix);
extern int cmd_status(int argc, const char **argv, const char *prefix);
extern int cmd_stripspace(int argc, const char **argv, const char *prefix);
extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
diff --git a/git.c b/git.c
index 194471f..5fabf18 100644
--- a/git.c
+++ b/git.c
@@ -358,8 +358,9 @@ static void handle_internal_command(int argc, const char **argv)
{ "rm", cmd_rm, RUN_SETUP },
{ "send-pack", cmd_send_pack, RUN_SETUP },
{ "shortlog", cmd_shortlog, USE_PAGER },
- { "show-branch", cmd_show_branch, RUN_SETUP },
{ "show", cmd_show, RUN_SETUP | USE_PAGER },
+ { "show-branch", cmd_show_branch, RUN_SETUP },
+ { "show-index", cmd_show_index },
{ "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
{ "stripspace", cmd_stripspace },
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },