{"thread":{"id":"8352","subject":"[PATCH] rev-parse: Identify short sha1 sums correctly.","startedAt":"2007-05-29T23:29:51Z","lastAt":"2007-05-30T01:09:50Z","messageCount":3,"participants":["James Bowes","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43588","messageId":"1180481391179-git-send-email-jbowes@dangerouslyinc.com","threadId":"8352","inReplyTo":null,"subject":"[PATCH] rev-parse: Identify short sha1 sums correctly.","fromName":"James Bowes","fromEmail":"jbowes@dangerouslyinc.com","sentAt":"2007-05-29T23:29:51Z","receivedAt":"2007-05-29T23:29:51Z","isPatch":true,"sender":{"key":"jbowes@dangerouslyinc.com","avatar":"https://gravatar.com/avatar/a2fe98c66b2b47a9fa9d2ba92ff949d54c3208b1f8acc2e745b4b84ae3c4483a?d=mp&s=160"},"body":"find_short_packed_object was not loading the pack index files.\nTeach it to do so.\n\nSigned-off-by: James Bowes <jbowes@dangerouslyinc.com>\n---\n sha1_name.c |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/sha1_name.c b/sha1_name.c\nindex 8dfceb2..7df01af 100644\n--- a/sha1_name.c\n+++ b/sha1_name.c\n@@ -76,8 +76,11 @@ static int find_short_packed_object(int len, const unsigned char *match, unsigne\n \n \tprepare_packed_git();\n \tfor (p = packed_git; p && found < 2; p = p->next) {\n-\t\tuint32_t num = p->num_objects;\n-\t\tuint32_t first = 0, last = num;\n+\t\tuint32_t num, last;\n+\t\tuint32_t first = 0;\n+\t\topen_pack_index(p);\n+\t\tnum = p->num_objects;\n+\t\tlast = num;\n \t\twhile (first < last) {\n \t\t\tuint32_t mid = (first + last) / 2;\n \t\t\tconst unsigned char *now;\n-- \n1.5.2.869.g6b3ba\n"},{"id":"43592","messageId":"7vtztv3zf1.fsf@assigned-by-dhcp.cox.net","threadId":"8352","inReplyTo":"1180481391179-git-send-email-jbowes@dangerouslyinc.com","subject":"Re: [PATCH] rev-parse: Identify short sha1 sums correctly.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-30T00:53:06Z","receivedAt":"2007-05-30T00:53:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, James.\n\nThis seems to fix the bug I mentioned about 'next' in the last\n\"What's cooking\" message.  Also I have been seeing a segfault\nfrom rev-parse in t5500 (rev-parse --short hits the same issue,\nbecause the bug caused object name not to be abreviated) but\nthat is also fixed with this patch.\n\nWill apply, instead of reverting the \"lazy index loading\".\n"},{"id":"43593","messageId":"3f80363f0705291809y23b1bf06j4076ecc09fe8c0d5@mail.gmail.com","threadId":"8352","inReplyTo":"7vtztv3zf1.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] rev-parse: Identify short sha1 sums correctly.","fromName":"James Bowes","fromEmail":"jbowes@dangerouslyinc.com","sentAt":"2007-05-30T01:09:50Z","receivedAt":"2007-05-30T01:09:50Z","isPatch":true,"sender":{"key":"jbowes@dangerouslyinc.com","avatar":"https://gravatar.com/avatar/a2fe98c66b2b47a9fa9d2ba92ff949d54c3208b1f8acc2e745b4b84ae3c4483a?d=mp&s=160"},"body":"On 5/29/07, Junio C Hamano <junkio@cox.net> wrote:\n> Thanks, James.\n\nGlad to help when I can.\n\n> This seems to fix the bug I mentioned about 'next' in the last\n> \"What's cooking\" message.  Also I have been seeing a segfault\n> from rev-parse in t5500 (rev-parse --short hits the same issue,\n> because the bug caused object name not to be abreviated) but\n> that is also fixed with this patch.\n>\n> Will apply, instead of reverting the \"lazy index loading\".\n>\n>\n>\n\n-James\n"}]}