git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, James Bowes <jbowes@dangerouslyinc.com>
Subject: Re: [PATCH] rev-parse: Identify short sha1 sums correctly.
Date: Tue, 29 May 2007 21:58:43 -0400	[thread overview]
Message-ID: <20070530015843.GH7044@spearce.org> (raw)
In-Reply-To: <7vabvn5hca.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> James Bowes <jbowes@dangerouslyinc.com> writes:
> 
> > find_short_packed_object was not loading the pack index files.
> > Teach it to do so.
> >
> > Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
> 
> I think this is the proper fix of the problem I was unhappy
> about with 'next', rather than reverting the lazy index
> loading.  But I wonder how many _other_ places like this there
> are that we might be missing...
> 
> Shawn, an Ack, and any ideas for futureproofing?

Ack, though late.  ;-)

I actually found this exact same bug today.  At first I thought it
was related to alternates, but when I dug into the code I came up
with basically the same patch as James did.  His was sent in first
and is logically identical, so I'm not going to send my version.

With regards to future proofing this, I have no idea.  I'm going to
write up a test case that catches this and submit that, to avoid a
future regression here, but otherwise I'm not sure what we can do.
I had thought I had visited every callsite and checked them, but
apparently that wasn't true.

What would probably help is to change the name of the structure
member in the .h file when its initialization time changes (or its
meaning changes in a subtle way) and then go through and manually
update every mention of the old name to the new name, then flip it
back with a global search and replace when done.

E.g. I should have done:

	* in cache.h rename num_objects to num_objects_SHAWNCHANGEHERE;
	* manually update every num_objects usage to my private name;
	* finally globally search-replace back to the standard name.

It would have forced me to more carefully visit every damn callsite.

I'll go back through the code tonight and double check my work,
because this bug was completely my fault.  I'm hoping this was the
only bug however.

-- 
Shawn.

  reply	other threads:[~2007-05-30  1:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1180478596243-git-send-email-jbowes@dangerouslyinc.com>
2007-05-29 23:40 ` [PATCH] rev-parse: Identify short sha1 sums correctly Junio C Hamano
2007-05-30  1:58   ` Shawn O. Pearce [this message]
2007-05-30  2:02   ` Shawn O. Pearce
2007-05-29 23:29 James Bowes
2007-05-30  0:53 ` Junio C Hamano
2007-05-30  1:09   ` James Bowes

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=20070530015843.GH7044@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=jbowes@dangerouslyinc.com \
    --cc=junkio@cox.net \
    /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).