Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-21 00:59:36 +0300
committerJunio C Hamano <gitster@pobox.com>2010-01-21 06:57:02 +0300
commit66b2ed09c2f0f212c5cd5c095c1f1052ecbb9491 (patch)
tree3dae0edece540e07d06146bb6a5dbf5f6873aec6 /revision.c
parent9504f3d3d2e62cb6fba9e7c61c6fe69dec9053a4 (diff)
Fix "log" family not to be too agressive about showing notes
Giving "Notes" information in the default output format of "log" and "show" is a sensible progress (the user has asked for it by having the notes), but for some commands (e.g. "format-patch") spewing notes into the formatted commit log message without being asked is too aggressive. Enable notes output only for "log", "show", "whatchanged" by default and only when the user didn't ask any specific --pretty/--format from the command line; users can explicitly override this default with --show-notes and --no-notes option. Parts of tests are taken from Jeff King's fix. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index a8a3c3a4bd..0de78fbad6 100644
--- a/revision.c
+++ b/revision.c
@@ -1161,10 +1161,18 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->verbose_header = 1;
} else if (!strcmp(arg, "--pretty")) {
revs->verbose_header = 1;
+ revs->pretty_given = 1;
get_commit_format(arg+8, revs);
} else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
revs->verbose_header = 1;
+ revs->pretty_given = 1;
get_commit_format(arg+9, revs);
+ } else if (!strcmp(arg, "--show-notes")) {
+ revs->show_notes = 1;
+ revs->show_notes_given = 1;
+ } else if (!strcmp(arg, "--no-notes")) {
+ revs->show_notes = 0;
+ revs->show_notes_given = 1;
} else if (!strcmp(arg, "--oneline")) {
revs->verbose_header = 1;
get_commit_format("oneline", revs);