From: Junio C Hamano Date: Sat, 29 Sep 2012 05:35:56 GMT Subject: Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages Message-ID: <7v4nmhjsqr.fsf@alter.siamese.dyndns.org> In-Reply-To: <1348893689-20240-1-git-send-email-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > On Sat, Sep 29, 2012 at 12:55 AM, Junio C Hamano wrote: >> 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=" 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.