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

Re: [PATCH] pretty: initialize new cmt_fmt_map to 0

From
Will Palmer <wmpalmer@gmail.com>
Date
May 8, 2010, 22:04 UTC
Message-ID
<1273356294.12996.5.camel@walleee>
In-Reply-To
<20100508210739.GA6486@progeny.tock>
On Sat, 2010-05-08 at 16:07 -0500, Jonathan Nieder wrote:
Show 15 quoted lines
> Without this change, is_alias is likely to happen to be nonzero,
> resulting in "fatal: invalid --pretty format" when the fake alias
> cannot be resolved.
> 
> Use memset instead of initializing the members one by one to make it
> easier to expand the struct in the future if needed.
> 
> t4205 (log --pretty) does not pass for me without this fix.
> 
> Cc: Will Palmer <wmpalmer@gmail.com>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
> Sorry I missed this before.  Sane?
> 
> Jonathan

Ah, looks right. I think previous versions of my patch were building in a local variable (which /was/ initialized), then copied the whole thing into the newly-allocated space. When this was changed to building in-place, the initialization was lost. Good catch, thanks.

Not sure if Signed-off-by or Reviewed-by is the appropriate tag to mention here, but one of those, I assume.

-- 
-- Will
Previous: Jonathan NiederNext: Junio C Hamano
Message 10 of 11 in “pretty: format aliases”
  1. 0/3 pretty: format aliasesWill Palmer, May 2, 2010
  2. 1/3 pretty: make it easier to add new formatsWill Palmer, May 2, 2010
  3. Jonathan NiederMay 2, 2010
  4. 2/3 pretty: add infrastructure to allow format aliasesWill Palmer, May 2, 2010
  5. Jonathan NiederMay 2, 2010
  6. 3/3 pretty: add aliases for pretty formatsWill Palmer, May 2, 2010
  7. Jonathan NiederMay 2, 2010
  8. Will PalmerMay 2, 2010
  9. pretty: initialize new cmt_fmt_map to 0Jonathan Nieder, May 8, 2010
  10. Will PalmerMay 8, 2010
  11. Junio C HamanoMay 2, 2010

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.