Skip to content

Use skip_blank_lines() for more commit messages

Johannes Schindelin git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5commit -C: skip blank lines at the beginning of the messagebuiltin/commit.c+1 -11 reply
2/5sequencer: use skip_blank_lines() to find the commit subjectsequencer.c+2 -41 reply
3/5reset --hard: skip blank lines when reporting the commit subjectbuiltin/reset.c+1 -10 replies
4/5commit -S: avoid invalid pointer with empty messagecommit.c+5 -10 replies
5/5Skip blank lines when matching <commit>^{/foo}sha1_name.c+2 -12 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/5] Use skip_blank_lines() for more commit messages

These patches are on top of js/find-commit-subject-ignore-leading-blanks (whether you want to put them into the same topic branch before merging or put them into their own add-on topic branch does not really matter to me).

It occurred to me that there might be more code locations where finding the commit object's body is hand-rolled, and could benefit from using the skip_blank_lines() function to handle not-quite-standard but still-allowed objects from being processed correctly.

I found a couple of instances, and made them consistent with the pretty-printing machinery.

I made fine-grained commits to allow for dropping contentious patches more easily.

There are four more instances which I did *not* change:

- fast-export: I designed this command to be as faithful in exporting the commits as possible. As such, even non-standard commit objects should be kept as-are.

- fmt-merge-msg: when showing signed commit messages, it is better to show the commit messages verbatim rather than trimming them.

- when signing a commit, it is better to use the original commit message than a munged one.

- notes' messages are left alone. I do not know whether there might be an intentional use of leading blank lines, but I wanted to err on the safe side.

I also considered treating tag messages the same way, but tags are much more likely to be signed, and I did not want to risk munging the tag messages just before signing them.

Johannes Schindelin (5):
commit -C: skip blank lines at the beginning of the message
sequencer: use skip_blank_lines() to find the commit subject reset --hard: skip blank lines when reporting the commit subject commit -S: avoid invalid pointer with empty message Skip blank lines when matching <commit>^{/foo}

 builtin/commit.c | 2 +-
 builtin/reset.c  | 2 +-
 commit.c         | 6 +++++-
 sequencer.c      | 6 ++----
 sha1_name.c      | 3 ++-
 5 files changed, 11 insertions(+), 8 deletions(-)

Published-As: https://github.com/dscho/git/releases/tag/more-blank-line-skipping-v1

Signature · 3 lines
2.9.0.270.g810e421

base-commit: 38a2ea1900489a76d9840002bf60bd7ff29f07cd