{"thread":{"id":"1675","subject":"[PATCH] git-rev-list: Don't die on a bad tag","startedAt":"2005-08-27T08:17:01Z","lastAt":"2005-08-27T09:14:57Z","messageCount":2,"participants":["Frank Sorenson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7841","messageId":"4310217D.80408@tuxrocks.com","threadId":"1675","inReplyTo":null,"subject":"[PATCH] git-rev-list: Don't die on a bad tag","fromName":"Frank Sorenson","fromEmail":"frank@tuxrocks.com","sentAt":"2005-08-27T08:17:01Z","receivedAt":"2005-08-27T08:17:01Z","isPatch":true,"sender":{"key":"frank@tuxrocks.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nThe current cogito tree contains an invalid tag\n(junio-gpg-pub => 0918385dbd9656cab0d1d81ba7453d49bbc16250), and\ngit-repack-script (and probably others) will die when git-rev-list\ntries to dump the objects.  This patch changes it to complain, but\ncontinue.\n\nSigned-off-by: Frank Sorenson <frank@tuxrocks.com>\n\n\ndiff --git a/rev-list.c b/rev-list.c\n- --- a/rev-list.c\n+++ b/rev-list.c\n@@ -418,8 +418,10 @@ static struct commit *get_commit_referen\n \t\tif (tag_objects && !(object->flags & UNINTERESTING))\n \t\t\tadd_pending_object(object, tag->tag);\n \t\tobject = parse_object(tag->tagged->sha1);\n- -\t\tif (!object)\n- -\t\t\tdie(\"bad object %s\", sha1_to_hex(tag->tagged->sha1));\n+\t\tif (!object) {\n+\t\t\tfprintf(stderr, \"Bad tag: %s\\n\", sha1_to_hex(tag->tagged->sha1));\n+\t\t\treturn NULL;\n+\t\t}\n \t}\n \n \t/*\n\n\nFrank\n- -- \nFrank Sorenson - KD7TZK\nSystems Manager, Computer Science Department\nBrigham Young University\nfrank@tuxrocks.com\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.1 (GNU/Linux)\nComment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org\n\niD8DBQFDECF9aI0dwg4A47wRAncdAKCIcNFzihLm9cy7RWRKakM6INikigCfcCvu\nR/XG+XlMsbgWesEvZcFBmQY=\n=OY7G\n-----END PGP SIGNATURE-----\n"},{"id":"7844","messageId":"7vacj3vizy.fsf@assigned-by-dhcp.cox.net","threadId":"1675","inReplyTo":"4310217D.80408@tuxrocks.com","subject":"Re: [PATCH] git-rev-list: Don't die on a bad tag","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-27T09:14:57Z","receivedAt":"2005-08-27T09:14:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Sorenson <frank@tuxrocks.com> writes:\n\n> The current cogito tree contains an invalid tag\n> (junio-gpg-pub => 0918385dbd9656cab0d1d81ba7453d49bbc16250), and\n> git-repack-script (and probably others) will die when git-rev-list\n> tries to dump the objects.  This patch changes it to complain, but\n> continue.\n>\n> Signed-off-by: Frank Sorenson <frank@tuxrocks.com>\n\nI think this patch is wrong.\n\nThe check you are disabling is to see if the repository contains\nan object that a tag refers to, and the user wanted to slurp the\ntag, along with whatever thing it refers to, so barfing and\ndying is the only right thing to do.\n\nThe repository does not have the object the tag points at.  IOW,\nthe repository is not fsck clean.\n\nIf it bothers you either you could drop that tag from cogito\nrepository (because there would not be anything that is signed\nby _my_ public key anyway), or borrow the object from git.git\nrepository.\n"}]}