Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [RFC PATCH 0/4] git log -g --pretty=format: learns about reflog

From: Jeff King <hidden>
Date: 2016-06-15 22:46:17

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help