{"thread":{"id":"8358","subject":"[PATCH] Test for recent rev-parse $abbrev_sha1 regression","startedAt":"2007-05-30T04:50:26Z","lastAt":"2007-05-30T06:28:42Z","messageCount":4,"participants":["Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43613","messageId":"20070530045026.GA12380@spearce.org","threadId":"8358","inReplyTo":null,"subject":"[PATCH] Test for recent rev-parse $abbrev_sha1 regression","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-05-30T04:50:26Z","receivedAt":"2007-05-30T04:50:26Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"My recent patch \"Lazily open pack index files on demand\" caused a\nregression in the case of parsing abbreviated SHA-1 object names.\nGit was unable to translate the abbreviated name into the full name\nif the object was packed, as the pack .idx files were not opened\nbefore being accessed.\n\nThis is a simple test to repack a repository then test for an\nabbreviated SHA-1 within the packfile.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n t/t6101-rev-parse-parents.sh |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh\nindex 7d354a1..b0252b9 100755\n--- a/t/t6101-rev-parse-parents.sh\n+++ b/t/t6101-rev-parse-parents.sh\n@@ -29,5 +29,15 @@ test_expect_success 'final^1^3 not valid' \"if git-rev-parse --verify final^1^3;\n test_expect_failure '--verify start2^1' 'git-rev-parse --verify start2^1'\n test_expect_success '--verify start2^0' 'git-rev-parse --verify start2^0'\n \n+test_expect_success 'repack for next test' 'git repack -a -d'\n+test_expect_success 'short SHA-1 works' '\n+\tstart=`git rev-parse --verify start` &&\n+\techo $start &&\n+\tabbrv=`echo $start | sed s/.\\$//` &&\n+\techo $abbrv &&\n+\tabbrv=`git rev-parse --verify $abbrv` &&\n+\techo $abbrv &&\n+\ttest $start = $abbrv'\n+\n test_done\n \n-- \n1.5.2.869.g6b3ba\n"},{"id":"43615","messageId":"7vlkf6508y.fsf@assigned-by-dhcp.cox.net","threadId":"8358","inReplyTo":"20070530045026.GA12380@spearce.org","subject":"Re: [PATCH] Test for recent rev-parse $abbrev_sha1 regression","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-30T05:49:49Z","receivedAt":"2007-05-30T05:49:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> My recent patch \"Lazily open pack index files on demand\" caused a\n> regression in the case of parsing abbreviated SHA-1 object names.\n> Git was unable to translate the abbreviated name into the full name\n> if the object was packed, as the pack .idx files were not opened\n> before being accessed.\n\nThanks.  As long as we catch it before it goes to 'master', it\nis not a regression ;-)\n"},{"id":"43616","messageId":"20070530055806.GQ7044@spearce.org","threadId":"8358","inReplyTo":"7vlkf6508y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Test for recent rev-parse $abbrev_sha1 regression","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-05-30T05:58:06Z","receivedAt":"2007-05-30T05:58:06Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> \"Shawn O. Pearce\" <spearce@spearce.org> writes:\n> \n> > My recent patch \"Lazily open pack index files on demand\" caused a\n> > regression in the case of parsing abbreviated SHA-1 object names.\n> > Git was unable to translate the abbreviated name into the full name\n> > if the object was packed, as the pack .idx files were not opened\n> > before being accessed.\n> \n> Thanks.  As long as we catch it before it goes to 'master', it\n> is not a regression ;-)\n \nGood point.  Next time I won't call it a regression.\n\nBut to me, anything that hits 'next' that breaks Git this badly is\na regression.  Why?  Because I run my production repositories off\nnext, that's why.  Of course I do this to exercise next more fully...\nto prevent this sort of stuff from getting to master.  ;-)\n\nFor what its worth, I'm going through the code again and auditing\nour use of the index related variables in packed_git that are now\nlazily loaded.  I'm not seeing anything that is critical.  I do\nhave two minor patches queued up, but they are just to make things\nlook prettier.  Will send soon.\n\n-- \nShawn.\n"},{"id":"43621","messageId":"7vzm3m3jvp.fsf@assigned-by-dhcp.cox.net","threadId":"8358","inReplyTo":"20070530055806.GQ7044@spearce.org","subject":"Re: [PATCH] Test for recent rev-parse $abbrev_sha1 regression","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-30T06:28:42Z","receivedAt":"2007-05-30T06:28:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shawn O. Pearce\" <spearce@spearce.org> writes:\n\n> But to me, anything that hits 'next' that breaks Git this badly is\n> a regression.  Why?  Because I run my production repositories off\n> next, that's why.  Of course I do this to exercise next more fully...\n> to prevent this sort of stuff from getting to master.  ;-)\n\nI'm almost always on 'next'.  I switch to run 'master' a few\ndays before -rc0 and a few days after the final feature release\nI switch back to 'next'.\n\nThe tip of 'next' may not be perfect, but it should not be so\nbroken that it is beyond a quick repair to inconvenience users\nthat rely on 'next' working.  And it helps us catch problems\nbefore the topics hit 'master'.\n\nBecause the tip of 'master' gets tagged only once every 6 weeks\nor so, its tip is not an official release at any other times,\nbut we effectively have the usual pre-release QA continuously\nrunning on the stuff that hits 'master'.  That's what 'next' is\nall about.\n\nAnd that's how we can keep our 'master' a lot more robust than\nthe development branches of other open source projects.\n"}]}