aboutsummaryrefslogtreecommitdiff
path: root/diff-tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-05 09:02:03 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-05 09:02:03 -0700
commit000182eacf99cde27d5916aa415921924b82972c (patch)
tree327229c4f38080e07424e752fa16dd2c8a915973 /diff-tree.c
parent848b292e835f10b0f859b22415be6e3fa951c55e (diff)
downloadgit-000182eacf99cde27d5916aa415921924b82972c.tar.gz
git-000182eacf99cde27d5916aa415921924b82972c.tar.xz
pretty_print_commit: add different formats
You can ask to print out "raw" format (full headers, full body), "medium" format (author and date, full body) or "short" format (author only, condensed body). Use "git-rev-list --pretty=short HEAD | less -S" for an example.
Diffstat (limited to 'diff-tree.c')
-rw-r--r--diff-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff-tree.c b/diff-tree.c
index 3881c23ca..6f8dc2024 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -19,6 +19,7 @@ static int diff_break_opt = -1;
static const char *orderfile = NULL;
static const char *header = NULL;
static const char *header_prefix = "";
+static enum cmit_fmt commit_format = CMIT_FMT_RAW;
// What paths are we interested in?
static int nr_paths = 0;
@@ -321,7 +322,7 @@ static char *generate_header(const char *commit, const char *parent, const char
offset = sprintf(this_header, "%s%s (from %s)\n", header_prefix, commit, parent);
if (verbose_header) {
- offset += pretty_print_commit(msg, len, this_header + offset, sizeof(this_header) - offset);
+ offset += pretty_print_commit(commit_format, msg, len, this_header + offset, sizeof(this_header) - offset);
this_header[offset++] = '\n';
this_header[offset++] = 0;
}