Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:53

Nguyễn Thái Ngọc Duy  [off-list ref] writes:
On Sat, Sep 29, 2012 at 12:55 AM, Junio C Hamano [off-list ref] wrote:
quoted
For that to happen, the code _must_ know what kind of headers we
would support; discarding the existing enum is going in a wrong
direction.
Or what kind of manipulation is required for a header. The caller can
decide if it wants such manipulation or not. Somebody might want to
grep committer's date, for example.
Yes, if we wanted to filter log outputs to commits authored only on
Thursdays, we would introduce --author-date="<some expression that
yields true only on Thursdays, given the timestmap" option, add
GREP_HEADER_AUTHOR_TIMESTAMP_EXPRESSION=2 to enum grep_header_field,
and add a new element { "author ", 7 } to grep.c::header_field[2]
(the index 2 matches GREP_HEADER_AUTHOR_TIMESTAMP_EXPRESSION), and
implement the evaluator for <some expression that yields true only
on Thursdays, given the timestamp> language in the GREP_PATTERN_HEAD
part of match_one_pattern() and use the p->field to select that
logic.  At that point, we may be better off introducing a helper
function to split the more complex logic for GREP_PATTERN_HEAD out
of the match_one_pattern() function.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help