diff options
| author | Junio C Hamano <gitster@pobox.com> | 2012-10-02 21:13:39 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2012-10-02 21:13:39 -0700 |
| commit | fa11d7c87940154f3f6463353335c6010b13e5db (patch) | |
| tree | a661388a8f6bf2e3adb17dde81a0fb15c3041e7b /grep.c | |
| parent | 5ce993a8126e4f428bc7862d4120b3ae81eb6a79 (diff) | |
| parent | 38cfe915bfc3ea0dbcbedaa82c44460a2ada2f42 (diff) | |
| download | git-fa11d7c87940154f3f6463353335c6010b13e5db.tar.gz | |
Merge branch 'nd/grep-reflog'
Teach the commands from the "log" family the "--grep-reflog" option
to limit output by string that appears in the reflog entry when the
"--walk-reflogs" option is in effect.
* nd/grep-reflog:
revision: make --grep search in notes too if shown
log --grep-reflog: reject the option without -g
revision: add --grep-reflog to filter commits by reflog messages
grep: prepare for new header field filter
Diffstat (limited to 'grep.c')
| -rw-r--r-- | grep.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -64,6 +64,8 @@ void append_header_grep_pattern(struct grep_opt *opt, { struct grep_pat *p = create_grep_pat(pat, strlen(pat), "header", 0, GREP_PATTERN_HEAD, field); + if (field == GREP_HEADER_REFLOG) + opt->use_reflog_filter = 1; do_append_grep_pat(&opt->header_tail, p); } @@ -697,6 +699,7 @@ static struct { } header_field[] = { { "author ", 7 }, { "committer ", 10 }, + { "reflog ", 7 }, }; static int match_one_pattern(struct grep_pat *p, char *bol, char *eol, @@ -720,7 +723,14 @@ static int match_one_pattern(struct grep_pat *p, char *bol, char *eol, if (strncmp(bol, field, len)) return 0; bol += len; - saved_ch = strip_timestamp(bol, &eol); + switch (p->field) { + case GREP_HEADER_AUTHOR: + case GREP_HEADER_COMMITTER: + saved_ch = strip_timestamp(bol, &eol); + break; + default: + break; + } } again: |
