git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Implement packed refs
Date: Tue, 15 May 2007 00:49:23 +0200	[thread overview]
Message-ID: <200705150049.24467.robin.rosenberg@dewire.com> (raw)
In-Reply-To: <20070514224533.GA28832@spearce.org>

tisdag 15 maj 2007 skrev Shawn O. Pearce:
> Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
> > index 76191be..3b2a82c 100644
> > @@ -411,6 +412,10 @@ public class Repository {
> >  	private Ref readRefBasic(String name) throws IOException {
> >  		int depth = 0;
> >  		REF_READING: do {
> > +			ObjectId id = packedRefs.get(name);
> > +			if (id != null)
> > +				return new Ref(null, id);
> > +
> >  			final File f = new File(getDirectory(), name);
> >  			if (!f.isFile()) {
> >  				return new Ref(f, null);
> 
> This is actually backwards.  Git checks the loose ref first, and
> then the packed ref.  The reason is so that users can pack all
> of their refs (git pack-refs --all) and then just create new ref
> files for those that they change, rather than rewriting the entire
> packed-refs file over again.
> 
> I'm adding a commit after your series to correct this.
Thanks.

> > +		} catch (IOException e) {
> > +			e.printStackTrace();
> > +		}
> 
> We really should be throwing exceptions back to the caller,
> especially on things that could indicate corruption or other
> problems with reading the repository contents.

Well, [looking for something to blame]... 

-- robin

  reply	other threads:[~2007-05-14 22:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-13 23:39 This week in EGIT - more tags Robin Rosenberg
2007-05-13 23:39 ` [PATCH] Implement simple tags Robin Rosenberg
2007-05-13 23:39   ` [PATCH] Write refs when creating tags Robin Rosenberg
2007-05-13 23:39     ` [PATCH] Implement packed refs Robin Rosenberg
2007-05-13 23:39       ` [PATCH] Show tags in history view Robin Rosenberg
2007-05-14 22:45       ` [PATCH] Implement packed refs Shawn O. Pearce
2007-05-14 22:49         ` Robin Rosenberg [this message]
2007-05-13 23:48   ` The first patch in the series Robin Rosenberg
2007-05-13 23:48     ` [PATCH] Require JDK1.5 Robin Rosenberg
2007-05-14  1:07       ` Grzegorz Kulewski
2007-05-14  7:21         ` Noel Grandin
2007-05-14 17:24           ` Robin Rosenberg
2007-05-14 20:56       ` [PATCH] Set required execution enviroment Robin Rosenberg

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=200705150049.24467.robin.rosenberg@dewire.com \
    --to=robin.rosenberg@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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).