if (revs->reflog_info && revs->graph)
die("cannot combine --walk-reflogs with --graph");
+ if (!revs->reflog_info && revs->grep_filter.use_reflog_filter)
+ die("cannot use --grep-reflog without --walk-reflogs");
return left;
}
struct strbuf buf = STRBUF_INIT;
if (!opt->grep_filter.pattern_list && !opt->grep_filter.header_list)
return 1;
- if (opt->reflog_info) {
+
+ /* Prepend "fake" headers as needed */
+ if (opt->grep_filter.use_reflog_filter) {
strbuf_addstr(&buf, "reflog ");
get_reflog_message(&buf, opt->reflog_info);
strbuf_addch(&buf, '\n');
+ }
+
+ /* Copy the commit to temporary if we are using "fake" headers */
+ 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);
else