Re: [PATCH 6/6] grep: obey --textconv for the case rev:path
- From
Jeff King <peff@peff.net>
- Date
- Apr 21, 2013, 03:41 UTC
- Message-ID
- <20130421034152.GB18890@sigill.intra.peff.net>
- In-Reply-To
- <5172A969.9000106@drmicha.warpmail.net>
On Sat, Apr 20, 2013 at 04:42:49PM +0200, Michael J Gruber wrote:
Show 6 quoted lines
> > And this mass of almost-the-same functions is gross, too, especially > > given that the object_context contains a mode itself. > > Well, it's just providing different ways to call into the one and only > function, in order to satisfy different callers' needs. It's not unheard > of (or rather: unseen) in our code, is it?
No, we have instances of it already. And they're ugly, too. :) I think when we hit more than 2 or 3 wrappers it is time to start thinking whether they can be consolidated. I think it is mostly the overlap in context and mode that makes me find this one particularly ugly. But it's probably not solvable without some pretty heavy refactoring.
> I vaguely seem to recall we had some more general framework cooking but > I may be wrong (I was offline due to sickness for a while). It was about > attaching some additional info to something. Yes, I said "vaguely" ...
Yeah, I really wanted to keep the context inside the object_array, but it means either wasting a lot of space (due to over-large buffers) or having the array elements be variable-sized (with a flex-array for the pathname). And object_array entries already have a memory-leak problem from the "name" field, which I think we just punt on elsewhere. So I think this is probably the lesser of the possible evils.
-Peff