Skip to content

Pretty formats for reflog data

Thomas Rast git 4 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 0 repliesNew
  2. v35 patches 5 repliesSuperseded
  3. v25 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC5 patches11 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Refactor pretty_print_commit arguments into a structarchive.c builtin-branch.c builtin-checkout.c +9 more+72 -460 replies
2/5reflog-walk: refactor the branch@{num} formattingreflog-walk.c+32 -220 replies
3/5Introduce new pretty formats %g[sdD] for reflog informationDocumentation/pretty-formats.txt commit.h log-tree.c +4 more+86 -30 replies
4/5stash list: use new %g formats instead of sedgit-stash.sh+1 -20 replies
5/5stash list: drop the default limit of 10 stashesDocumentation/git-stash.txt git-stash.sh+1 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/5] Pretty formats for reflog data
Quoted 6 lines · Junio C Hamano

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< --

t/t5001-archive-attr.sh +1 -1
index 426b319..0950527 100755
@@ -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(-)