diff options
author | Junio C Hamano <junkio@cox.net> | 2005-08-08 22:15:40 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-09 22:28:23 -0700 |
commit | d87449c553262a24df26648633c7c73b2db7dcc6 (patch) | |
tree | 8ff9a656ea6b550dd915444fa2f18c86338f63cf /rev-list.c | |
parent | 62033318abbe648e8be49121b0a3570c07d38a9d (diff) | |
download | git-d87449c553262a24df26648633c7c73b2db7dcc6.tar.gz git-d87449c553262a24df26648633c7c73b2db7dcc6.tar.xz |
Introduce --pretty=oneline format.
This introduces --pretty=oneline to git-rev-tree and
git-rev-list commands to show only the first line of the commit
message, without frills.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'rev-list.c')
-rw-r--r-- | rev-list.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rev-list.c b/rev-list.c index 1a03bf7b3..ce5b8b2ad 100644 --- a/rev-list.c +++ b/rev-list.c @@ -63,7 +63,11 @@ static void show_commit(struct commit *commit) parents = parents->next; } } - putchar('\n'); + if (commit_format == CMIT_FMT_ONELINE) + putchar(' '); + else + putchar('\n'); + if (verbose_header) { static char pretty_header[16384]; pretty_print_commit(commit_format, commit->buffer, ~0, pretty_header, sizeof(pretty_header)); @@ -503,7 +507,10 @@ int main(int argc, char **argv) commit_format = get_commit_format(arg+8); verbose_header = 1; hdr_termination = '\n'; - prefix = "commit "; + if (commit_format == CMIT_FMT_ONELINE) + prefix = ""; + else + prefix = "commit "; continue; } if (!strncmp(arg, "--no-merges", 11)) { |