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

[Feature request] "Hooks" for git log

From
KTKonstantin Tokarev <annulen@yandex.ru>
Date
Mar 12, 2020, 15:06 UTC
Message-ID
<558831584024173@sas1-438a02fc058e.qloud-c.yandex.net>
Hello,

While it's possible to filter commits in `git log` by their contents with --grep and -S options, it's not always possible for formulate desirable filter in their terms.

I think it would be very useful if git log provided new option named e.g. --hook or --script, which would take script path as an argument. git log would follow it's normal way of operation, applying other filtering options it was given, however intstead of printing info on commit that matches filters, it invokes script with commit hash as an argument. Script can do whatever it needs with hash, including any git operations, can print commit info to log if needed, or print something else, or keep silence. If script returns non-zero, parent git log command terminates, otherwise it continues.

-- 
Regards,
Konstantin
Next: Konstantin Tokarev
Message 1 of 6 in “[Feature request] "Hooks" for git log”
  1. Konstantin TokarevMar 12, 2020
  2. Konstantin TokarevMar 12, 2020
  3. Junio C HamanoMar 12, 2020
  4. Konstantin TokarevMar 12, 2020
  5. Konstantin TokarevMar 12, 2020
  6. Junio C HamanoMar 12, 2020

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.