From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Remove diff machinery dependency from read-cache
Date: Thu, 21 Jan 2010 19:50:11 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.00.1001211949250.13231@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.00.1001211823590.13231@localhost.localdomain>
On Thu, 21 Jan 2010, Linus Torvalds wrote:
>
> This makes it a built-in, at least, so it doesn't waste the diskspace.
.. and here's 'git hash-object' as a built-in.
Linus
---
Makefile | 2 +-
hash-object.c => builtin-hash-object.c | 5 +----
builtin.h | 1 +
git.c | 1 +
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 35aea16..f9e4aa3 100644
--- a/Makefile
+++ b/Makefile
@@ -387,7 +387,6 @@ EXTRA_PROGRAMS =
# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS += $(EXTRA_PROGRAMS)
PROGRAMS += git-fast-import$X
-PROGRAMS += git-hash-object$X
PROGRAMS += git-imap-send$X
PROGRAMS += git-index-pack$X
PROGRAMS += git-merge-index$X
@@ -656,6 +655,7 @@ BUILTIN_OBJS += builtin-for-each-ref.o
BUILTIN_OBJS += builtin-fsck.o
BUILTIN_OBJS += builtin-gc.o
BUILTIN_OBJS += builtin-grep.o
+BUILTIN_OBJS += builtin-hash-object.o
BUILTIN_OBJS += builtin-help.o
BUILTIN_OBJS += builtin-init-db.o
BUILTIN_OBJS += builtin-log.o
diff --git a/hash-object.c b/builtin-hash-object.c
similarity index 97%
rename from hash-object.c
rename to builtin-hash-object.c
index 9455dd0..6a5f5b5 100644
--- a/hash-object.c
+++ b/builtin-hash-object.c
@@ -73,17 +73,14 @@ static const struct option hash_object_options[] = {
OPT_END()
};
-int main(int argc, const char **argv)
+int cmd_hash_object(int argc, const char **argv, const char *prefix)
{
int i;
- const char *prefix = NULL;
int prefix_length = -1;
const char *errstr = NULL;
type = blob_type;
- git_extract_argv0_path(argv[0]);
-
argc = parse_options(argc, argv, NULL, hash_object_options,
hash_object_usage, 0);
diff --git a/builtin.h b/builtin.h
index 06bf04e..3aa6b6c 100644
--- a/builtin.h
+++ b/builtin.h
@@ -55,6 +55,7 @@ extern int cmd_fsck(int argc, const char **argv, const char *prefix);
extern int cmd_gc(int argc, const char **argv, const char *prefix);
extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
extern int cmd_grep(int argc, const char **argv, const char *prefix);
+extern int cmd_hash_object(int argc, const char **argv, const char *prefix);
extern int cmd_help(int argc, const char **argv, const char *prefix);
extern int cmd_http_fetch(int argc, const char **argv, const char *prefix);
extern int cmd_init_db(int argc, const char **argv, const char *prefix);
diff --git a/git.c b/git.c
index e5964a8..a952663 100644
--- a/git.c
+++ b/git.c
@@ -318,6 +318,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "gc", cmd_gc, RUN_SETUP },
{ "get-tar-commit-id", cmd_get_tar_commit_id },
{ "grep", cmd_grep, USE_PAGER },
+ { "hash-object", cmd_hash_object },
{ "help", cmd_help },
{ "init", cmd_init_db },
{ "init-db", cmd_init_db },
next prev parent reply other threads:[~2010-01-22 3:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 19:37 Remove diff machinery dependency from read-cache Linus Torvalds
2010-01-21 20:07 ` Junio C Hamano
2010-01-21 20:15 ` Linus Torvalds
2010-01-21 22:18 ` Linus Torvalds
2010-01-21 23:25 ` Linus Torvalds
2010-01-22 0:45 ` Junio C Hamano
2010-01-22 0:59 ` Johannes Schindelin
2010-01-22 1:01 ` Junio C Hamano
2010-01-22 1:43 ` Johannes Schindelin
2010-01-22 3:50 ` Junio C Hamano
2010-01-22 2:20 ` Linus Torvalds
2010-01-22 2:25 ` Linus Torvalds
2010-01-22 3:50 ` Linus Torvalds [this message]
2010-01-22 8:43 ` Johannes Sixt
2010-01-22 11:47 ` [PATCH] merge-tree: remove unnecessary call of git_extract_argv0_path Johannes Sixt
2010-01-22 16:40 ` Linus Torvalds
2010-01-22 2:35 ` Remove diff machinery dependency from read-cache Nicolas Pitre
2010-01-22 2:44 ` Linus Torvalds
2010-01-22 3:56 ` Junio C Hamano
2010-01-22 4:21 ` Linus Torvalds
2010-01-22 4:31 ` Linus Torvalds
2010-01-22 3:58 ` Linus Torvalds
2010-01-23 6:31 ` Brian Campbell
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=alpine.LFD.2.00.1001211949250.13231@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=spearce@spearce.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).