Re: [RFC PATCH 0/4] git log -g --pretty=format: learns about reflog
- From
Jeff King <peff@peff.net>
- Date
- Feb 26, 2009, 10:55 UTC
- Message-ID
- <20090226105527.GC4226@coredump.intra.peff.net>
- In-Reply-To
- <cover.1235622145.git.deskinm@umich.edu>
On Wed, Feb 25, 2009 at 11:44:03PM -0500, Deskin Miller wrote:
> I'm a little leery of using commit->util to carry the reflog info, but I > didn't see a much better way, without altering the signature of > pretty_print_commit to take an optional reflog parameter. The code
Personally I am not opposed to some refactoring of the pretty_print code. A few months ago I wanted to add a new pretty-printing feature (it was keeping count of the total and printed patches, so you could say something "Patch %count/%total"). Passing information around through all of the functions got quite burdensome, and I started a refactoring to have a "pretty_print_context" that could be passed around and contain a lot of the pseudo-global variables.
I didn't get very far before giving up and working on something else. But my point is that any refactoring you do may end up helping other features in the future.
As a side note, I also think figuring out what the formats look like by reading the pretty-print code is insane, because it is a mass of special cases and switch statements on format. I think it would be much more manageable "inside-out": each format has its own primary function, and the common stuff is factored out into helpers.
But that's just based on memory from a few months ago.
-Peff