git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Johannes Schindelin
Message 7 of 7 in “git log -g --pretty=format: learns about reflog”
  1. 0/4 git log -g --pretty=format: learns about reflogDeskin Miller, Feb 26, 2009
  2. 1/4 Expose reflog_info struct in headerDeskin Miller, Feb 26, 2009
  3. 2/4 Add attach_reflog_infoDeskin Miller, Feb 26, 2009
  4. 3/4 Attach reflog to commit prior to pretty-printingDeskin Miller, Feb 26, 2009
  5. 4/4 Teach pretty-printer new reflog format codesDeskin Miller, Feb 26, 2009
  6. Johannes SchindelinFeb 26, 2009
  7. Jeff KingFeb 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.