git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Wooding <mdw@distorted.org.uk>
To: git@vger.kernel.org
Subject: [PATCH] Make fsck and fsck-objects be builtins.
Date: Mon, 29 Jan 2007 15:48:06 +0000 (UTC)	[thread overview]
Message-ID: <slrners5pm.3l6.mdw@metalzone.distorted.org.uk> (raw)
In-Reply-To: 7vsldubqof.fsf@assigned-by-dhcp.cox.net

The earlier change df391b192 to rename fsck-objects to fsck broke
fsck-objects.  This should fix it again.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
---
 Makefile                 |    1 +
 fsck.c => builtin-fsck.c |    3 +--
 builtin.h                |    1 +
 git.c                    |    2 ++
 4 files changed, 5 insertions(+), 2 deletions(-)
 rename fsck.c => builtin-fsck.c (100%)

Without this, I get 

[metalzone ~/src/git]git fsck-objects
fatal: cannot handle fsck-objects internally

which isn't really very helpful.  I thought about hacking the makefile
to manufacture a hardlink from git-fsck-objects, but this just seemed so
much easier.  And we are slowly accumulating builtins, right? ;-)

diff --git a/Makefile b/Makefile
index 1552b2a..91bd665 100644
--- a/Makefile
+++ b/Makefile
@@ -284,6 +284,7 @@ BUILTIN_OBJS = \
 	builtin-diff-tree.o \
 	builtin-fmt-merge-msg.o \
 	builtin-for-each-ref.o \
+	builtin-fsck.o \
 	builtin-grep.o \
 	builtin-init-db.o \
 	builtin-log.o \
diff --git a/fsck.c b/builtin-fsck.c
similarity index 100%
rename from fsck.c
rename to builtin-fsck.c
index 558f0a6..fec1cbd 100644
--- a/fsck.c
+++ b/builtin-fsck.c
@@ -571,12 +571,11 @@ static int fsck_cache_tree(struct cache_tree *it)
 	return err;
 }
 
-int main(int argc, char **argv)
+int cmd_fsck(int argc, char **argv, const char *prefix)
 {
 	int i, heads;
 
 	track_object_refs = 1;
-	setup_git_directory();
 
 	for (i = 1; i < argc; i++) {
 		const char *arg = argv[i];
diff --git a/builtin.h b/builtin.h
index cfe5990..dd0e352 100644
--- a/builtin.h
+++ b/builtin.h
@@ -34,6 +34,7 @@ extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);
 extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
 extern int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
 extern int cmd_format_patch(int argc, const char **argv, const char *prefix);
+extern int cmd_fsck(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_help(int argc, const char **argv, const char *prefix);
diff --git a/git.c b/git.c
index d21e5e5..fb03a54 100644
--- a/git.c
+++ b/git.c
@@ -235,6 +235,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
 		{ "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
 		{ "for-each-ref", cmd_for_each_ref, RUN_SETUP },
 		{ "format-patch", cmd_format_patch, RUN_SETUP },
+		{ "fsck", cmd_fsck, RUN_SETUP },
+		{ "fsck-objects", cmd_fsck, RUN_SETUP },
 		{ "get-tar-commit-id", cmd_get_tar_commit_id },
 		{ "grep", cmd_grep, RUN_SETUP },
 		{ "help", cmd_help },
-- 
1.5.0.rc2.75.gdbaa0-dirty

-- [mdw]

  reply	other threads:[~2007-01-29 15:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-27  6:28 git user's manual J. Bruce Fields
2007-01-28  0:22 ` [PATCH] user-manual: set user.name and user.email with repo-config Matthias Lederhofer
2007-01-28  0:32   ` Linus Torvalds
2007-01-28  1:34     ` Matthias Lederhofer
2007-01-28  1:47       ` Linus Torvalds
2007-01-28  2:04         ` Junio C Hamano
2007-01-28  8:52           ` Jakub Narebski
2007-01-28  2:40         ` Tom Prince
2007-01-28  7:44           ` Junio C Hamano
2007-01-28 22:18             ` Junio C Hamano
2007-01-28  2:55         ` Nicolas Pitre
2007-01-28  8:50         ` Jakub Narebski
2007-01-28 23:34         ` J. Bruce Fields
2007-01-28 23:49           ` Linus Torvalds
2007-01-29  0:52             ` Junio C Hamano
2007-01-29 15:48               ` Mark Wooding [this message]
2007-01-29 17:35                 ` [PATCH] Make fsck and fsck-objects be builtins Junio C Hamano
2007-01-29  6:39   ` [PATCH] user-manual: set user.name and user.email with repo-config J. Bruce Fields

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=slrners5pm.3l6.mdw@metalzone.distorted.org.uk \
    --to=mdw@distorted.org.uk \
    --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).