git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 29, 2012, 05:35 UTC
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  <pclouds@gmail.com> writes:
Show 8 quoted lines
> On Sat, Sep 29, 2012 at 12:55 AM, Junio C Hamano <gitster@pobox.com> 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="<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.

Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 23 of 25 in “revision: add --reflog-message=<pattern> to grep reflog messages”
  1. revision: add --reflog-message=<pattern> to grep reflog messagesNguyễn Thái Ngọc Duy, Sep 26, 2012
  2. Junio C HamanoSep 26, 2012
  3. Nguyen Thai Ngoc DuySep 26, 2012
  4. Junio C HamanoSep 26, 2012
  5. revision: add --reflog-message to grep reflog messagesNguyễn Thái Ngọc Duy, Sep 27, 2012
  6. Junio C HamanoSep 27, 2012
  7. Jeff KingSep 27, 2012
  8. Junio C HamanoSep 27, 2012
  9. 1/3 grep: generalize header grep code to accept arbitrary headersNguyễn Thái Ngọc Duy, Sep 28, 2012
  10. 2/3 revision: add --grep-reflog to filter commits by reflog messagesNguyễn Thái Ngọc Duy, Sep 28, 2012
  11. Junio C HamanoSep 28, 2012
  12. Nguyễn Thái Ngọc DuySep 29, 2012
  13. 1/3 grep: prepare for new header field filterNguyễn Thái Ngọc Duy, Sep 29, 2012
  14. Jeff KingSep 29, 2012
  15. 2/3 revision: add --grep-reflog to filter commits by reflog messagesNguyễn Thái Ngọc Duy, Sep 29, 2012
  16. Jeff KingSep 29, 2012
  17. Junio C HamanoSep 29, 2012
  18. Nguyen Thai Ngoc DuySep 29, 2012
  19. Junio C HamanoSep 29, 2012
  20. Nguyen Thai Ngoc DuySep 30, 2012
  21. Jeff KingSep 29, 2012
  22. 3/3 revision: make --grep search in notes too if shownNguyễn Thái Ngọc Duy, Sep 29, 2012
  23. Junio C HamanoSep 29, 2012
  24. 3/3 revision: make --grep search in notes too if shownNguyễn Thái Ngọc Duy, Sep 28, 2012
  25. Junio C HamanoSep 28, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.