@matheusbsbs / matheus-bagliano / commits / dedc0ec5d7
Fork 0

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>

Linus Torvalds committed Jan 21, 2010 at 20:31 UTC dedc0ec5d778214528dae3bddf60d77cfcde4bd4
4 files changed +4 -4
Makefile
+1 -1
@@ -392,7 +392,6 @@ PROGRAMS += git-index-pack$X
392 PROGRAMS += git-merge-index$X
393 PROGRAMS += git-mktag$X
394 PROGRAMS += git-pack-redundant$X
395 -PROGRAMS += git-patch-id$X
395 PROGRAMS += git-shell$X
396 PROGRAMS += git-show-index$X
397 PROGRAMS += git-unpack-file$X
@@ -676,6 +675,7 @@ BUILTIN_OBJS += builtin-mv.o
675 BUILTIN_OBJS += builtin-name-rev.o
676 BUILTIN_OBJS += builtin-pack-objects.o
677 BUILTIN_OBJS += builtin-pack-refs.o
678 +BUILTIN_OBJS += builtin-patch-id.o
679 BUILTIN_OBJS += builtin-prune-packed.o
680 BUILTIN_OBJS += builtin-prune.o
681 BUILTIN_OBJS += builtin-push.o
builtin-patch-id.c renamed
+1 -3
@@ -75,13 +75,11 @@ static void generate_id_list(void)
75
76 static const char patch_id_usage[] = "git patch-id < patch";
77
78 -int main(int argc, char **argv)
78 +int cmd_patch_id(int argc, const char **argv, const char *prefix)
79 {
80 if (argc != 1)
81 usage(patch_id_usage);
82
83 - git_extract_argv0_path(argv[0]);
84 -
83 generate_id_list();
84 return 0;
85 }
builtin.h
+1
@@ -76,6 +76,7 @@ extern int cmd_mktree(int argc, const char **argv, const char *prefix);
76 extern int cmd_mv(int argc, const char **argv, const char *prefix);
77 extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
78 extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
79 +extern int cmd_patch_id(int argc, const char **argv, const char *prefix);
80 extern int cmd_pickaxe(int argc, const char **argv, const char *prefix);
81 extern int cmd_prune(int argc, const char **argv, const char *prefix);
82 extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
git.c
+1
@@ -341,6 +341,7 @@ static void handle_internal_command(int argc, const char **argv)
341 { "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },
342 { "name-rev", cmd_name_rev, RUN_SETUP },
343 { "pack-objects", cmd_pack_objects, RUN_SETUP },
344 + { "patch-id", cmd_patch_id },
345 { "peek-remote", cmd_ls_remote },
346 { "pickaxe", cmd_blame, RUN_SETUP },
347 { "prune", cmd_prune, RUN_SETUP },