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 18:20:14 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.00.1001211811140.13231@localhost.localdomain> (raw)
In-Reply-To: <7v636vj7c2.fsf@alter.siamese.dyndns.org>
On Thu, 21 Jan 2010, Junio C Hamano wrote:
>
> We tend to not remove things unless we are absolutely certain nobody uses
> it, so probably making it built-in would be preferrable. I don't think
> show-index is used very often if ever, but scripts that use hash-object
> would use it really often and would do so via its --stdin interface if it
> knows that it is creating more than a dozen objects, so start-up time
> required to map the whole git is probably not an issue.
git-show-index should certainly be easy to turn into a built-in too. Patch
appended.
> By the way, do you think anybody still uses "git merge-trees"?
I dunno. I think it has some conceptual advantages, but realistically, I
doubt anybody is willing to go through the pain to make it grow up enough
to become a viable alternative to our current situation.
Linus
---
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Jan 21 18:16:49 2010 -0800
Subject: Turn 'show-index' into a builtin
.. rather than being a huge executable just because it sucks in all the
git library code and then does something really trivial.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
Makefile | 2 +-
show-index.c => builtin-show-index.c | 2 +-
builtin.h | 1 +
git.c | 3 ++-
4 files changed, 5 insertions(+), 3 deletions(-)
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 },
next prev parent reply other threads:[~2010-01-22 2:20 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 [this message]
2010-01-22 2:25 ` Linus Torvalds
2010-01-22 3:50 ` Linus Torvalds
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.1001211811140.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).