diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2012-09-29 11:41:29 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-29 12:15:05 -0700 |
commit | 38cfe915bfc3ea0dbcbedaa82c44460a2ada2f42 (patch) | |
tree | 1ea3151ef7bbd0f6466aad8268d768c3a08e6c13 /revision.c | |
parent | baa6378ff2106738c74213280904507d0ed8129c (diff) | |
download | git-38cfe915bfc3ea0dbcbedaa82c44460a2ada2f42.tar.gz |
revision: make --grep search in notes too if shown
Notes are shown after commit body. From user perspective it looks
pretty much like commit body and they may assume --grep would search
in that part too.
Make it so.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 9f5e9df93c..a09e60bedb 100644 --- a/revision.c +++ b/revision.c @@ -2231,6 +2231,14 @@ static int commit_match(struct commit *commit, struct rev_info *opt) if (buf.len) strbuf_addstr(&buf, commit->buffer); + /* Append "fake" message parts as needed */ + if (opt->show_notes) { + if (!buf.len) + strbuf_addstr(&buf, commit->buffer); + format_display_notes(commit->object.sha1, &buf, + get_log_output_encoding(), 0); + } + /* Find either in the commit object, or in the temporary */ if (buf.len) retval = grep_buffer(&opt->grep_filter, buf.buf, buf.len); |