summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1e61b76)
raw | patch | inline | side by side (parent: 1e61b76)
author | Ren\e,bi\e(B Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Mon, 3 Sep 2007 18:06:36 +0000 (20:06 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Sep 2007 23:46:02 +0000 (16:46 -0700) |
Drop the parameter "msg" of format_commit_message() (as it can be
inferred from the parameter "commit"), add a parameter "template"
in order to avoid accessing the static variable user_format
directly and export the result.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
inferred from the parameter "commit"), add a parameter "template"
in order to avoid accessing the static variable user_format
directly and export the result.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c | patch | blob | history | |
commit.h | patch | blob | history |
diff --git a/commit.c b/commit.c
index dc5a0643f3d52797f29706595355fca824d9feda..99f65cee0e7e30e833f850b5993aa8a5797ba889 100644 (file)
--- a/commit.c
+++ b/commit.c
interp_set_entry(table, 6, show_date(date, tz, DATE_ISO8601));
}
-static long format_commit_message(const struct commit *commit,
- const char *msg, char **buf_p, unsigned long *space_p)
+long format_commit_message(const struct commit *commit, const void *format,
+ char **buf_p, unsigned long *space_p)
{
struct interp table[] = {
{ "%H" }, /* commit hash */
char parents[1024];
int i;
enum { HEADER, SUBJECT, BODY } state;
+ const char *msg = commit->buffer;
if (ILEFT_RIGHT + 1 != ARRAY_SIZE(table))
die("invalid interp table!");
char *buf = *buf_p;
unsigned long space = *space_p;
- space = interpolate(buf, space, user_format,
+ space = interpolate(buf, space, format,
table, ARRAY_SIZE(table));
if (!space)
break;
char *buf;
if (fmt == CMIT_FMT_USERFORMAT)
- return format_commit_message(commit, msg, buf_p, space_p);
+ return format_commit_message(commit, user_format, buf_p, space_p);
encoding = (git_log_output_encoding
? git_log_output_encoding
diff --git a/commit.h b/commit.h
index 467872eecabf05ccedbb9bf8247b6de244416b8f..a8d76616d2ae6965ebca3c197232e1b7c9294585 100644 (file)
--- a/commit.h
+++ b/commit.h
};
extern enum cmit_fmt get_commit_format(const char *arg);
+extern long format_commit_message(const struct commit *commit, const void *template, char **buf_p, unsigned long *space_p);
extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *, unsigned long len, char **buf_p, unsigned long *space_p, int abbrev, const char *subject, const char *after_subject, enum date_mode dmode);
/** Removes the first commit from a list sorted by date, and adds all