From: Jeff King Date: Mon, 06 Feb 2012 08:11:19 GMT Subject: Re: [RFC/PATCH] tag: add --points-at list option Message-ID: <20120206081119.GA3939@sigill.intra.peff.net> In-Reply-To: <20120206074558.GA24535@sigill.intra.peff.net> On Mon, Feb 06, 2012 at 02:45:58AM -0500, Jeff King wrote: > > Hmm, the "filter->lines" code for "git tag -n" makes a similar error. It > > should probably print nothing for objects that are not tags. > > Ugh, this part of builtin/tag.c is riddled with small bugs. I'm > preparing a series that will fix them, and hopefully it should make > building your points-at patch on top much more pleasant. So here's what I ended up with: [1/3]: tag: fix output of "tag -n" when errors occur [2/3]: tag: die when listing missing or corrupt objects [3/3]: tag: don't show non-tag contents with "-n" I had hoped to have a 4th patch teach "tag -n" to use parse_object instead of read_sha1_file directly. That way we could avoid reading tag objects multiple times when things like "--contains" or "--points-at" are used. But we don't actually cache the body of an annotated tag, only its headers. So the "tag -n" code has to read the object fresh. I do still think it's worth using the parse_object interface for the "--points-at" feature. -Peff