aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 20:31:25 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-21 22:06:12 -0800
commitdedc0ec5d778214528dae3bddf60d77cfcde4bd4 (patch)
tree5964fc516cb2366117ba9474a9c21ba826f1eb93
parent55b6745d633b9501576eb02183da0b0fb1cee964 (diff)
downloadgit-dedc0ec5d778214528dae3bddf60d77cfcde4bd4.tar.gz
git-dedc0ec5d778214528dae3bddf60d77cfcde4bd4.tar.xz
make "git patch-id" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Makefile2
-rw-r--r--builtin-patch-id.c (renamed from patch-id.c)4
-rw-r--r--builtin.h1
-rw-r--r--git.c1
4 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 4558c4627..e1c7ae585 100644
--- a/Makefile
+++ b/Makefile
@@ -392,7 +392,6 @@ PROGRAMS += git-index-pack$X
PROGRAMS += git-merge-index$X
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
@@ -676,6 +675,7 @@ BUILTIN_OBJS += builtin-mv.o
BUILTIN_OBJS += builtin-name-rev.o
BUILTIN_OBJS += builtin-pack-objects.o
BUILTIN_OBJS += builtin-pack-refs.o
+BUILTIN_OBJS += builtin-patch-id.o
BUILTIN_OBJS += builtin-prune-packed.o
BUILTIN_OBJS += builtin-prune.o
BUILTIN_OBJS += builtin-push.o
diff --git a/patch-id.c b/builtin-patch-id.c
index 0df4cb086..af0911e4b 100644
--- a/patch-id.c
+++ b/builtin-patch-id.c
@@ -75,13 +75,11 @@ static void generate_id_list(void)
static const char patch_id_usage[] = "git patch-id < patch";
-int main(int argc, char **argv)
+int cmd_patch_id(int argc, const char **argv, const char *prefix)
{
if (argc != 1)
usage(patch_id_usage);
- git_extract_argv0_path(argv[0]);
-
generate_id_list();
return 0;
}
diff --git a/builtin.h b/builtin.h
index 2d95c3b2f..cb8489f97 100644
--- a/builtin.h
+++ b/builtin.h
@@ -76,6 +76,7 @@ extern int cmd_mktree(int argc, const char **argv, const char *prefix);
extern int cmd_mv(int argc, const char **argv, const char *prefix);
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
+extern int cmd_patch_id(int argc, const char **argv, const char *prefix);
extern int cmd_pickaxe(int argc, const char **argv, const char *prefix);
extern int cmd_prune(int argc, const char **argv, const char *prefix);
extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
diff --git a/git.c b/git.c
index cf7dd5d26..b60999ca9 100644
--- a/git.c
+++ b/git.c
@@ -341,6 +341,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },
{ "name-rev", cmd_name_rev, RUN_SETUP },
{ "pack-objects", cmd_pack_objects, RUN_SETUP },
+ { "patch-id", cmd_patch_id },
{ "peek-remote", cmd_ls_remote },
{ "pickaxe", cmd_blame, RUN_SETUP },
{ "prune", cmd_prune, RUN_SETUP },