{"thread":{"id":"3606","subject":"fsck-object --standalone got errors","startedAt":"2006-03-09T02:35:08Z","lastAt":"2006-03-09T10:37:08Z","messageCount":3,"participants":["Ming Lei","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"17354","messageId":"440F945C.2010401@brocade.com","threadId":"3606","inReplyTo":null,"subject":"fsck-object --standalone got errors","fromName":"Ming Lei","fromEmail":"mlei@brocade.com","sentAt":"2006-03-09T02:35:08Z","receivedAt":"2006-03-09T02:35:08Z","isPatch":false,"sender":{"key":"mlei@brocade.com","avatar":null},"body":"I have a repository created by GIT itself(not cognito, etc). It has \nbranches called base, master and origin. When I did git-fsck-objects \n--full there is nothing shown, but when I did git-fsck-objects \n--standalone, it displayed following:\n\nerror: refs/heads/master: invalid sha1 pointer \nea51c414519ffe78c5bf95c488e94e82d3603472\nerror: refs/heads/base: invalid sha1 pointer \n4b75aaeb5af2dc69374ad080020758e4de6a45d2\nerror: refs/heads/origin: invalid sha1 pointer \nf4c9503abb2ad52752004e8e9b77b72e23d18d3e\nfatal: No default references\n\n\nThe question is:\nwhat's the purpose for this standalone check? what's these errors about? \nDo I need to care these errors?\nwhat's the step to ensure my repository always be in a good shape? Is \nrunning fsck-objects --full sufficient?\n\n\nThanks\nMing\n"},{"id":"17355","messageId":"7v7j74fgsh.fsf@assigned-by-dhcp.cox.net","threadId":"3606","inReplyTo":"440F945C.2010401@brocade.com","subject":"Re: fsck-object --standalone got errors","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-09T03:17:18Z","receivedAt":"2006-03-09T03:17:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ming Lei <mlei@brocade.com> writes:\n\n> I have a repository created by GIT itself(not cognito, etc). It has\n> branches called base, master and origin. When I did git-fsck-objects\n> --full there is nothing shown, but when I did git-fsck-objects\n> --standalone, it displayed following:\n\nThat is really an artifact from a distant past.  Please do not\nworry about that error -- as long as --full does not see\nanything long, there is nothing wrong with your repository.\n\nThe fsck-object command (back then it was called fsck-cache)\ncomplained if objects referred to by files in .git/refs/ or\nobjects stored in files under .git/objects/??/ are not found as\nstand-alone SHA1 files (i.e.  found in alternate object pools or\npacked archives stored under .git/objects/pack).  Back then,\npacks and alternates were curiosity and having everything as\nloose objects were the norm.\n\nWhen we adjusted the behaviour of fsck-cache to consider objects\nfound in packs are OK, we introduced the --standalone flag as a\nbackward compatibility measure.\n\nIt still correctly checks if your repository is complete and\nconsists only of loose objects, so in that sense it is doing the\n\"right\" thing, but checking that is pointless these days.  We\nprobably should remove that flag.\n"},{"id":"17365","messageId":"7v4q277vl7.fsf@assigned-by-dhcp.cox.net","threadId":"3606","inReplyTo":"7v7j74fgsh.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] fsck-objects: Remove --standalone","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-09T10:37:08Z","receivedAt":"2006-03-09T10:37:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The fsck-objects command (back then it was called fsck-cache)\nused to complain if objects referred to by files in .git/refs/\nor objects stored in files under .git/objects/??/ were not found\nas stand-alone SHA1 files (i.e.  found in alternate object pools\nor packed archives stored under .git/objects/pack).  Back then,\npacks and alternates were new curiosity and having everything as\nloose objects were the norm.\n\nWhen we adjusted the behaviour of fsck-cache to consider objects\nfound in packs are OK, we introduced the --standalone flag as a\nbackward compatibility measure.\n\nIt still correctly checks if your repository is complete and\nconsists only of loose objects, so in that sense it is doing the\n\"right\" thing, but checking that is pointless these days.  This\ncommit removes --standalone flag.\n\nSee also:\n\n\t23676d407c63a6f67f8ce3ff192199bda03e6a03\n\t8a498a05c3c6b2f53db669b24f36257ab213eb4c\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * The flag itself is harmless and it still is working as\n   advertized and documented, but I think it outlived its\n   usefulness.  I do not expect any objections against the\n   removal but just in case...\n\n Documentation/git-fsck-objects.txt |   15 ++++-----------\n fsck-objects.c                     |   18 ++++--------------\n 2 files changed, 8 insertions(+), 25 deletions(-)\n\n8f9c5c27d9d5dfe0a5f26646e39ebc48df0eb25c\ndiff --git a/Documentation/git-fsck-objects.txt b/Documentation/git-fsck-objects.txt\nindex 387b435..93ce9dc 100644\n--- a/Documentation/git-fsck-objects.txt\n+++ b/Documentation/git-fsck-objects.txt\n@@ -10,7 +10,7 @@ SYNOPSIS\n --------\n [verse]\n 'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache]\n-\t\t [--standalone | --full] [--strict] [<object>*]\n+\t\t [--full] [--strict] [<object>*]\n \n DESCRIPTION\n -----------\n@@ -38,21 +38,14 @@ index file and all SHA1 references in .g\n \tConsider any object recorded in the index also as a head node for\n \tan unreachability trace.\n \n---standalone::\n-\tLimit checks to the contents of GIT_OBJECT_DIRECTORY\n-\t($GIT_DIR/objects), making sure that it is consistent and\n-\tcomplete without referring to objects found in alternate\n-\tobject pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES,\n-\tnor packed git archives found in $GIT_DIR/objects/pack;\n-\tcannot be used with --full.\n-\n --full::\n \tCheck not just objects in GIT_OBJECT_DIRECTORY\n \t($GIT_DIR/objects), but also the ones found in alternate\n-\tobject pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES,\n+\tobject pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES\n+\tor $GIT_DIR/objects/info/alternates,\n \tand in packed git archives found in $GIT_DIR/objects/pack\n \tand corresponding pack subdirectories in alternate\n-\tobject pools; cannot be used with --standalone.\n+\tobject pools.\n \n --strict::\n \tEnable more strict checking, namely to catch a file mode\ndiff --git a/fsck-objects.c b/fsck-objects.c\nindex 4ddd676..9cc8572 100644\n--- a/fsck-objects.c\n+++ b/fsck-objects.c\n@@ -14,7 +14,6 @@\n static int show_root = 0;\n static int show_tags = 0;\n static int show_unreachable = 0;\n-static int standalone = 0;\n static int check_full = 0;\n static int check_strict = 0;\n static int keep_cache_objects = 0; \n@@ -68,7 +67,7 @@ static void check_connectivity(void)\n \t\t\tcontinue;\n \n \t\tif (!obj->parsed) {\n-\t\t\tif (!standalone && has_sha1_file(obj->sha1))\n+\t\t\tif (has_sha1_file(obj->sha1))\n \t\t\t\t; /* it is in pack */\n \t\t\telse\n \t\t\t\tprintf(\"missing %s %s\\n\",\n@@ -82,7 +81,7 @@ static void check_connectivity(void)\n \t\t\tfor (j = 0; j < refs->count; j++) {\n \t\t\t\tstruct object *ref = refs->ref[j];\n \t\t\t\tif (ref->parsed ||\n-\t\t\t\t    (!standalone && has_sha1_file(ref->sha1)))\n+\t\t\t\t    (has_sha1_file(ref->sha1)))\n \t\t\t\t\tcontinue;\n \t\t\t\tprintf(\"broken link from %7s %s\\n\",\n \t\t\t\t       obj->type, sha1_to_hex(obj->sha1));\n@@ -390,7 +389,7 @@ static int fsck_handle_ref(const char *r\n \n \tobj = lookup_object(sha1);\n \tif (!obj) {\n-\t\tif (!standalone && has_sha1_file(sha1)) {\n+\t\tif (has_sha1_file(sha1)) {\n \t\t\tdefault_refs++;\n \t\t\treturn 0; /* it is in a pack */\n \t\t}\n@@ -464,10 +463,6 @@ int main(int argc, char **argv)\n \t\t\tkeep_cache_objects = 1;\n \t\t\tcontinue;\n \t\t}\n-\t\tif (!strcmp(arg, \"--standalone\")) {\n-\t\t\tstandalone = 1;\n-\t\t\tcontinue;\n-\t\t}\n \t\tif (!strcmp(arg, \"--full\")) {\n \t\t\tcheck_full = 1;\n \t\t\tcontinue;\n@@ -477,14 +472,9 @@ int main(int argc, char **argv)\n \t\t\tcontinue;\n \t\t}\n \t\tif (*arg == '-')\n-\t\t\tusage(\"git-fsck-objects [--tags] [--root] [[--unreachable] [--cache] [--standalone | --full] [--strict] <head-sha1>*]\");\n+\t\t\tusage(\"git-fsck-objects [--tags] [--root] [[--unreachable] [--cache] [--full] [--strict] <head-sha1>*]\");\n \t}\n \n-\tif (standalone && check_full)\n-\t\tdie(\"Only one of --standalone or --full can be used.\");\n-\tif (standalone)\n-\t\tputenv(\"GIT_ALTERNATE_OBJECT_DIRECTORIES=\");\n-\n \tfsck_head_link();\n \tfsck_object_dir(get_object_directory());\n \tif (check_full) {\n-- \n1.2.4.g2acc\n"}]}