libgit2

git_message_prettify

Version:

Clean up excess whitespace and make sure there is a trailing newline in the message.

Optionally, it can remove lines which start with the comment character.

Signature

int git_message_prettify(git_buf *out, const char *message, int strip_comments, char comment_char);

Parameters

In
out

The user-allocated git_buf which will be filled with the cleaned up message.

const char *
In
message

The message to be prettified.

int
In
strip_comments

Non-zero to remove comment lines, 0 to leave them in.

char
In
comment_char

Comment character. Lines starting with this character are considered to be comments and removed if strip_comments is non-zero.

Returns

int

0 or an error code.

Versions