Blame include/git2/message.h

Packit ae9e2a
/*
Packit ae9e2a
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit ae9e2a
 *
Packit ae9e2a
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit ae9e2a
 * a Linking Exception. For full terms see the included COPYING file.
Packit ae9e2a
 */
Packit ae9e2a
#ifndef INCLUDE_git_message_h__
Packit ae9e2a
#define INCLUDE_git_message_h__
Packit ae9e2a
Packit ae9e2a
#include "common.h"
Packit ae9e2a
#include "buffer.h"
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * @file git2/message.h
Packit ae9e2a
 * @brief Git message management routines
Packit ae9e2a
 * @ingroup Git
Packit ae9e2a
 * @{
Packit ae9e2a
 */
Packit ae9e2a
GIT_BEGIN_DECL
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Clean up message from excess whitespace and make sure that the last line
Packit ae9e2a
 * ends with a '\n'.
Packit ae9e2a
 *
Packit ae9e2a
 * Optionally, can remove lines starting with a "#".
Packit ae9e2a
 *
Packit ae9e2a
 * @param out The user-allocated git_buf which will be filled with the
Packit ae9e2a
 *     cleaned up message.
Packit ae9e2a
 *
Packit ae9e2a
 * @param message The message to be prettified.
Packit ae9e2a
 *
Packit ae9e2a
 * @param strip_comments Non-zero to remove comment lines, 0 to leave them in.
Packit ae9e2a
 *
Packit ae9e2a
 * @param comment_char Comment character. Lines starting with this character
Packit ae9e2a
 * are considered to be comments and removed if `strip_comments` is non-zero.
Packit ae9e2a
 *
Packit ae9e2a
 * @return 0 or an error code.
Packit ae9e2a
 */
Packit ae9e2a
GIT_EXTERN(int) git_message_prettify(git_buf *out, const char *message, int strip_comments, char comment_char);
Packit ae9e2a
Packit ae9e2a
/** @} */
Packit ae9e2a
GIT_END_DECL
Packit ae9e2a
Packit ae9e2a
#endif /* INCLUDE_git_message_h__ */