Re: [Feature request] "Hooks" for git log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




12.03.2020, 18:06, "Konstantin Tokarev" <annulen@xxxxxxxxx>:
> 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.

On the second thought, its user interface should probably be more like
`git submodule foreach` to allow use of one-liners. For example, there is a
bug which I've recently reported that prevents use of 

git log --follow --full-diff <path>

It could have been worked around easily as

git log --follow <path> foreach git show $1

(syntax may be different)

-- 
Regards,
Konstantin




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux