summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04fe2a1)
raw | patch | inline | side by side (parent: 04fe2a1)
author | Linus Torvalds <torvalds@osdl.org> | |
Sun, 5 Feb 2006 19:42:09 +0000 (11:42 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 5 Feb 2006 21:46:19 +0000 (13:46 -0800) |
It _might_ make sense for certain users like gitk and gitview if
we had a single tool that gives --pretty and its diff even if
the diff is empty. Having said that, the flag --cc -m is too
specific. If some uses want to see the commit log even for an
empty diff, that flag should not be something only --cc honors.
Here's an "--always" flag that does that.
Signed-off-by: Junio C Hamano <junkio@cox.net>
we had a single tool that gives --pretty and its diff even if
the diff is empty. Having said that, the flag --cc -m is too
specific. If some uses want to see the commit log even for an
empty diff, that flag should not be something only --cc honors.
Here's an "--always" flag that does that.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff-tree.c | patch | blob | history |
diff --git a/diff-tree.c b/diff-tree.c
index 6593a6920adcdb81fafad94ba2cf96431e6ceec9..2df23c65fdf84b511069c516810debec74fe7d2b 100644 (file)
--- a/diff-tree.c
+++ b/diff-tree.c
static int combine_merges = 0;
static int dense_combined_merges = 0;
static int read_stdin = 0;
+static int always_show_header = 0;
static const char *header = NULL;
static const char *header_prefix = "";
offset += pretty_print_commit(commit_format, commit, len,
this_header + offset,
sizeof(this_header) - offset, abbrev);
+ if (always_show_header) {
+ puts(this_header);
+ return NULL;
+ }
return this_header;
}
no_commit_id = 1;
continue;
}
+ if (!strcmp(arg, "--always")) {
+ always_show_header = 1;
+ continue;
+ }
usage(diff_tree_usage);
}
if (diff_options.output_format == DIFF_FORMAT_PATCH)