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

Re: [PATCH] '%S' option for pretty printing to support --source

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 5, 2009, 10:59 UTC
Message-ID
<alpine.DEB.1.00.0903051157070.6524@intel-tinevez-2-302>
In-Reply-To
<20090305091758.GC30445@coredump.intra.peff.net>
Hi,
On Thu, 5 Mar 2009, Jeff King wrote:
Show 20 quoted lines
> On Thu, Mar 05, 2009 at 09:18:28AM +0200, Petri Hodju wrote:
> 
> > +static void format_source(struct strbuf *sb, const struct commit *commit)
> > +{
> > +    if (commit->util)
> > +	strbuf_addstr(sb, (char *) commit->util);
> > +}
> > +
> 
> Hmm. This is the second patch in the last few weeks to use commit->util
> to carry information for --pretty=format: (I am cc'ing Deskin Miller,
> who wrote the first).
> 
> They cannot both work, obviously. So we need to do one of:
> 
>   - refactor the information out of commit->util to somewhere else
> 
>   - allow multiple commit->util users somehow (which I think is a
>     potential performance problem -- the simplistic design is meant to
>     avoid things like allocation overhead)

The common way to do this is to use struct decoration. I was under the impression that --source already used that method (IIRC both --source and struct decoration come from Linus, the latter of which having been rejected when I submitted it as a struct object_hash patch, which would have been a better name IMHO).

Ciao, Dscho

Previous: Jeff KingNext: Deskin Miller
Message 3 of 5 in “'%S' option for pretty printing to support --source”
  1. '%S' option for pretty printing to support --sourcePetri Hodju, Mar 5, 2009
  2. Jeff KingMar 5, 2009
  3. Johannes SchindelinMar 5, 2009
  4. Deskin MillerMar 5, 2009
  5. Jeff KingMar 6, 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.