From: Junio C Hamano <gitster@pobox.com>
To: drafnel@gmail.com
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 2/5] Make mktag a builtin.
Date: Sun, 11 May 2008 10:36:45 -0700 [thread overview]
Message-ID: <7vprrs4uaa.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7v63tk6992.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 11 May 2008 10:28:09 -0700")
Junio C Hamano <junio@pobox.com> writes:
> drafnel@gmail.com writes:
>
>> From: Brandon Casey <drafnel@gmail.com>
>>
>> Signed-off-by: Brandon Casey <drafnel@gmail.com>
>
>> @@ -306,6 +305,7 @@ BUILT_INS += git-fsck-objects$X
>> BUILT_INS += git-get-tar-commit-id$X
>> BUILT_INS += git-init$X
>> BUILT_INS += git-merge-subtree$X
>> +BUILT_INS += git-mktag$X
>> BUILT_INS += git-peek-remote$X
>> BUILT_INS += git-repo-config$X
>> BUILT_INS += git-show$X
>> @@ -423,6 +423,7 @@ LIB_OBJS += log-tree.o
>> LIB_OBJS += mailmap.o
>> LIB_OBJS += match-trees.o
>> LIB_OBJS += merge-file.o
>> +LIB_OBJS += mktag.o
>
> This is unusual for a builtin. Why didn't it migrate to builtin-mktag?
That is, something along this line, instead.
-- >8 --
From: Brandon Casey <drafnel@gmail.com>
Date: Thu, 8 May 2008 21:19:46 -0500
Subject: [PATCH] Make mktag a builtin
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Makefile | 2 +-
mktag.c => builtin-mktag.c | 4 +---
builtin.h | 1 +
git.c | 1 +
4 files changed, 4 insertions(+), 4 deletions(-)
rename mktag.c => builtin-mktag.c (98%)
diff --git a/Makefile b/Makefile
index 9d84c8d..3980dc9 100644
--- a/Makefile
+++ b/Makefile
@@ -282,7 +282,6 @@ PROGRAMS += git-imap-send$X
PROGRAMS += git-index-pack$X
PROGRAMS += git-merge-index$X
PROGRAMS += git-merge-tree$X
-PROGRAMS += git-mktag$X
PROGRAMS += git-mktree$X
PROGRAMS += git-pack-redundant$X
PROGRAMS += git-patch-id$X
@@ -510,6 +509,7 @@ BUILTIN_OBJS += builtin-merge-base.o
BUILTIN_OBJS += builtin-merge-file.o
BUILTIN_OBJS += builtin-merge-ours.o
BUILTIN_OBJS += builtin-merge-recursive.o
+BUILTIN_OBJS += builtin-mktag.o
BUILTIN_OBJS += builtin-mv.o
BUILTIN_OBJS += builtin-name-rev.o
BUILTIN_OBJS += builtin-pack-objects.o
diff --git a/mktag.c b/builtin-mktag.c
similarity index 98%
rename from mktag.c
rename to builtin-mktag.c
index a45a5e7..1596900 100644
--- a/mktag.c
+++ b/builtin-mktag.c
@@ -149,7 +149,7 @@ static int verify_tag(const char *buffer, size_t size)
#undef PD_FMT
-int main(int argc, char **argv)
+int cmd_mktag(int argc, const char **argv, const char *prefix)
{
struct strbuf buf;
unsigned char result_sha1[20];
@@ -157,8 +157,6 @@ int main(int argc, char **argv)
if (argc != 1)
usage("git-mktag < signaturefile");
- setup_git_directory();
-
strbuf_init(&buf, 0);
if (strbuf_read(&buf, 0, 4096) < 0) {
die("could not read from stdin");
diff --git a/builtin.h b/builtin.h
index 95126fd..a8d3a11 100644
--- a/builtin.h
+++ b/builtin.h
@@ -58,6 +58,7 @@ extern int cmd_merge_base(int argc, const char **argv, const char *prefix);
extern int cmd_merge_ours(int argc, const char **argv, const char *prefix);
extern int cmd_merge_file(int argc, const char **argv, const char *prefix);
extern int cmd_merge_recursive(int argc, const char **argv, const char *prefix);
+extern int cmd_mktag(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);
diff --git a/git.c b/git.c
index 89b431f..81aa31c 100644
--- a/git.c
+++ b/git.c
@@ -325,6 +325,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "merge-ours", cmd_merge_ours, RUN_SETUP },
{ "merge-recursive", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },
{ "merge-subtree", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },
+ { "mktag", cmd_mktag, RUN_SETUP },
{ "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },
{ "name-rev", cmd_name_rev, RUN_SETUP },
{ "pack-objects", cmd_pack_objects, RUN_SETUP },
--
1.5.5.1.295.g4c42f
next prev parent reply other threads:[~2008-05-11 17:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1210299589-10448-1-git-send-email-drafnel@example.com>
2008-05-09 2:19 ` [PATCH 1/5] mktag.c: adjust verify_tag parameters drafnel
2008-05-11 18:39 ` Junio C Hamano
2008-05-12 15:43 ` Brandon Casey
[not found] ` <1210299589-10448-2-git-send-email-drafnel@example.com>
2008-05-09 2:19 ` [PATCH 2/5] Make mktag a builtin drafnel
2008-05-11 17:28 ` Junio C Hamano
2008-05-11 17:36 ` Junio C Hamano [this message]
2008-05-12 15:09 ` Brandon Casey
2008-05-12 17:04 ` Johannes Schindelin
2008-05-12 17:32 ` Brandon Casey
2008-05-12 18:41 ` Junio C Hamano
[not found] ` <1210299589-10448-3-git-send-email-drafnel@example.com>
2008-05-09 2:19 ` [PATCH 3/5] mktag.c: rename verify_tag to verify_tag_buffer drafnel
[not found] ` <1210299589-10448-4-git-send-email-drafnel@example.com>
2008-05-09 2:19 ` [PATCH 4/5] mktag.c: consolidate tag functions by merging mktag.c into builtin-tag.c drafnel
[not found] ` <1210299589-10448-5-git-send-email-drafnel@example.com>
2008-05-09 2:19 ` [PATCH 5/5] git-tag: call verify_tag_buffer to validate the generated tag object drafnel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vprrs4uaa.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=drafnel@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).