summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62a604b)
raw | patch | inline | side by side (parent: 62a604b)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 27 Jan 2006 09:54:59 +0000 (01:54 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 28 Jan 2006 08:09:39 +0000 (00:09 -0800) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit.c | patch | blob | history | |
commit.h | patch | blob | history | |
diff-tree.c | patch | blob | history | |
rev-list.c | patch | blob | history | |
show-branch.c | patch | blob | history |
diff --git a/commit.c b/commit.c
index 244104f930b46f0fd1414712446d511d6237ff5d..e8f53e89664446faa1ec6e77f5f02fec64a74bb4 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -456,12 +456,13 @@ static int add_parent_info(enum cmit_fmt fmt, char *buf, const char *line, int p
return offset;
}
-unsigned long pretty_print_commit(enum cmit_fmt fmt, const char *msg, unsigned long len, char *buf, unsigned long space, int abbrev)
+unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit, unsigned long len, char *buf, unsigned long space, int abbrev)
{
int hdr = 1, body = 0;
unsigned long offset = 0;
int parents = 0;
int indent = (fmt == CMIT_FMT_ONELINE) ? 0 : 4;
+ const char *msg = commit->buffer;
for (;;) {
const char *line = msg;
diff --git a/commit.h b/commit.h
index a8c20964e02256696f974d8a98d514a91c03029d..986b22de8abd01e7404bc4f195be0d11baefb13a 100644 (file)
--- a/commit.h
+++ b/commit.h
};
extern enum cmit_fmt get_commit_format(const char *arg);
-extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const char *msg, unsigned long len, char *buf, unsigned long space, int abbrev);
+extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *, unsigned long len, char *buf, unsigned long space, int abbrev);
/** Removes the first commit from a list sorted by date, and adds all
* of its parents.
diff --git a/diff-tree.c b/diff-tree.c
index efa17d14a4495937ff4ef27ceba3c76fa76134db..44bc2381c9cd4ab6e10e8bd8b519b564a1b9014b 100644 (file)
--- a/diff-tree.c
+++ b/diff-tree.c
static const char *generate_header(const unsigned char *commit_sha1,
const unsigned char *parent_sha1,
- const char *msg)
+ const struct commit *commit)
{
static char this_header[16384];
int offset;
unsigned long len;
int abbrev = diff_options.abbrev;
+ const char *msg = commit->buffer;
if (!verbose_header)
return sha1_to_hex(commit_sha1);
offset += sprintf(this_header + offset, "(from %s)\n",
parent_sha1 ?
diff_unique_abbrev(parent_sha1, abbrev) : "root");
- offset += pretty_print_commit(commit_format, msg, len,
+ offset += pretty_print_commit(commit_format, commit, len,
this_header + offset,
sizeof(this_header) - offset, abbrev);
return this_header;
/* Root commit? */
if (show_root_diff && !commit->parents) {
- header = generate_header(sha1, NULL, commit->buffer);
+ header = generate_header(sha1, NULL, commit);
diff_root_tree(commit_sha1, "");
}
for (parents = commit->parents; parents; parents = parents->next) {
struct commit *parent = parents->item;
- header = generate_header(sha1,
- parent->object.sha1,
- commit->buffer);
+ header = generate_header(sha1, parent->object.sha1, commit);
diff_tree_sha1_top(parent->object.sha1, commit_sha1, "");
if (!header && verbose_header) {
header_prefix = "\ndiff-tree ";
diff --git a/rev-list.c b/rev-list.c
index 5fad300635de8901db000510f6fd12a0fbdcae6e..334713ab66371c7ad239b28eec321d016352e943 100644 (file)
--- a/rev-list.c
+++ b/rev-list.c
if (verbose_header) {
static char pretty_header[16384];
- pretty_print_commit(commit_format, commit->buffer, ~0, pretty_header, sizeof(pretty_header), 0);
+ pretty_print_commit(commit_format, commit, ~0, pretty_header, sizeof(pretty_header), 0);
printf("%s%c", pretty_header, hdr_termination);
}
fflush(stdout);
diff --git a/show-branch.c b/show-branch.c
index d06e577401c67c1d6aed3b5538fccf1eea26567f..ffe7456a6a8b44276a8779cabf16e4613b268ec0 100644 (file)
--- a/show-branch.c
+++ b/show-branch.c
char pretty[256], *cp;
struct commit_name *name = commit->object.util;
if (commit->object.parsed)
- pretty_print_commit(CMIT_FMT_ONELINE, commit->buffer, ~0,
+ pretty_print_commit(CMIT_FMT_ONELINE, commit, ~0,
pretty, sizeof(pretty), 0);
else
strcpy(pretty, "(unavailable)");