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

[PATCH v4 0/5] Pretty formats for reflog data

From
Thomas Rast <trast@student.ethz.ch>
Date
Oct 19, 2009, 15:48 UTC
Message-ID
<cover.1255966426.git.trast@student.ethz.ch>
In-Reply-To
<7vaazonwtr.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 6 quoted lines
> 
> One solution to help the compiler catch this kind of semantic crash upon
> merging or applying code based on the old format_commit_message() would
> have been to change its function signature (or even the name), so that it
> would not go unnoticed that DATE_NORMAL that happens to be "0" is silently
> interpreted as (void *)0 == NULL.

Indeed, that would have been a good idea. (I still don't fully see the use of allowing an enum value as a pointer, but apparently the standard's that way.)

I fixed the calls to format_commit_message(), but without changing the function signature compared to the last patch. I also decided not to put in the test case; the easiest I could come up with was the following:

-- 8< --
diff --git i/t/t5001-archive-attr.sh w/t/t5001-archive-attr.sh
index 426b319..0950527 100755
--- i/t/t5001-archive-attr.sh
+++ w/t/t5001-archive-attr.sh
@@ -4,7 +4,7 @@ test_description='git archive attribute tests'
 
 . ./test-lib.sh
 
-SUBSTFORMAT=%H%n
+SUBSTFORMAT=%H%ad%n
 
 test_expect_exists() {
 	test_expect_success " $1 exists" "test -e $1"
-- >8 --

which immediately fails most tests in the file because of segfaults
with the buggy series.  However, it still wouldn't catch other broken
callers, if there were any, so I left it out.

Compared to v3, I also rebased the series on current master, which
conflicted with 7f98ebc (format_commit_message(): fix function
signature, 2009-10-15) so you now need that commit to apply it.

Finally, I squashed a revert of 0a0c342 (git-stash documentation:
mention default options for 'list', 2009-10-12) into 5/5 since there
are no more default options after my patch.


Thomas Rast (5):
  Refactor pretty_print_commit arguments into a struct
  reflog-walk: refactor the branch@{num} formatting
  Introduce new pretty formats %g[sdD] for reflog information
  stash list: use new %g formats instead of sed
  stash list: drop the default limit of 10 stashes

 Documentation/git-stash.txt      |    3 +-
 Documentation/pretty-formats.txt |    9 ++++
 archive.c                        |    4 +-
 builtin-branch.c                 |    3 +-
 builtin-checkout.c               |    3 +-
 builtin-commit.c                 |    8 +++-
 builtin-log.c                    |    3 +-
 builtin-merge.c                  |    7 ++-
 builtin-rev-list.c               |    7 ++-
 builtin-shortlog.c               |    9 +++-
 builtin-show-branch.c            |    4 +-
 commit.h                         |   20 ++++++---
 git-stash.sh                     |    8 +---
 log-tree.c                       |   25 ++++++-----
 pretty.c                         |   44 ++++++++++++++------
 reflog-walk.c                    |   83 ++++++++++++++++++++++++++++----------
 reflog-walk.h                    |    8 ++++
 t/t6006-rev-list-format.sh       |   18 ++++++++
 18 files changed, 189 insertions(+), 77 deletions(-)
Previous: Junio C HamanoNext: Thomas Rast
Message 12 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.