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

Re: [PATCH v3 1/5] Refactor pretty_print_commit arguments into a struct

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 17, 2009, 17:05 UTC
Message-ID
<7vljja7xy8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<9d3d0f0a6126afc86689138adf58ac7a12c43858.1255701207.git.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 13 quoted lines
> pretty_print_commit() has a bunch of rarely-used arguments, and
> introducing more of them requires yet another update of all the call
> sites.  Refactor most of them into a struct to make future extensions
> easier.
>
> The ones that stay "plain" arguments were chosen on the grounds that
> all callers put real arguments there, whereas some callers have 0/NULL
> for all arguments that were factored into the struct.
>
> We declare the struct 'const' to ensure none of the callers are bitten
> by the changed (no longer call-by-value) semantics.
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Good idea, a slightly sloppy/careless execution.

The existing calls to format_commit_message() often take DATE_NORMAL to its "enum date_mode dmode" argument, and you replaced it with a pointer to a struct. DATE_NORMAL happens to be "0" and the compiler does not catch calls you forgot to convert in this patch.

Previous: Thomas RastNext: Thomas Rast
Message 9 of 31 in “Pretty formats for reflog data”
  1. 0/5 Pretty formats for reflog dataThomas Rast, Oct 15, 2009
  2. 1/5 Refactor pretty_print_commit arguments into a structThomas Rast, Oct 15, 2009
  3. 2/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 15, 2009
  4. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 15, 2009
  5. Jeff KingOct 16, 2009
  6. Thomas RastOct 16, 2009
  7. 0/5 Pretty formats for reflog dataThomas Rast, Oct 16, 2009
  8. 1/5 Refactor pretty_print_commit arguments into a structThomas Rast, Oct 16, 2009
  9. Junio C HamanoOct 17, 2009
  10. Thomas RastOct 18, 2009
  11. Junio C HamanoOct 18, 2009
  12. 0/5 Pretty formats for reflog dataThomas Rast, Oct 19, 2009
  13. 1/5 Refactor pretty_print_commit arguments into a structThomas Rast, Oct 19, 2009
  14. 2/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 19, 2009
  15. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 19, 2009
  16. 4/5 stash list: use new %g formats instead of sedThomas Rast, Oct 19, 2009
  17. 5/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 19, 2009
  18. 2/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 16, 2009
  19. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 16, 2009
  20. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 17, 2009
  21. Jakub NarebskiOct 17, 2009
  22. Jeff KingOct 18, 2009
  23. Nanako ShiraishiOct 18, 2009
  24. 4/5 stash list: use new %g formats instead of sedThomas Rast, Oct 16, 2009
  25. 5/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 16, 2009
  26. Junio C HamanoOct 17, 2009
  27. Jeff KingOct 17, 2009
  28. 4/5 stash list: use new %g formats instead of sedThomas Rast, Oct 15, 2009
  29. 5/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 15, 2009
  30. Jeff KingOct 16, 2009
  31. Jakub NarebskiOct 16, 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.