git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Tokarev <annulen@yandex.ru>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: [Feature request] "Hooks" for git log
Date: Thu, 12 Mar 2020 18:06:44 +0300	[thread overview]
Message-ID: <558831584024173@sas1-438a02fc058e.qloud-c.yandex.net> (raw)

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



             reply	other threads:[~2020-03-12 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 15:06 Konstantin Tokarev [this message]
2020-03-12 16:21 ` [Feature request] "Hooks" for git log Konstantin Tokarev
2020-03-12 18:58 ` Junio C Hamano
2020-03-12 19:08   ` Konstantin Tokarev
2020-03-12 19:24     ` Konstantin Tokarev
2020-03-12 19:31       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558831584024173@sas1-438a02fc058e.qloud-c.yandex.net \
    --to=annulen@yandex.ru \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).