Sandro Turriate

Coder, cook, explorer

How to view commits by author in tig

Feb 22, 2022

Instead of starting tig and grepping for an author, start tig with the --author option.

tig command showing author
tig --author=NAME

If you’re like me, you have almost no idea how to use tig. You just start it up and view commits. Indeed, that’s its strength. So it’s news to me that tig can be used as an arbitrary pager. You can pipe normal git commands into it, like git status | tig or even ls | tig if you want! But its real power lies in calling tig in scenarios where you’d normally call git.

Tig operates on the information that’s fed into it, which is why you can’t open tig and then filter by author the same way you can with git log. Instead of trying to filter in tig’s text-mode interface, you need to start tig with the information already filtered. This can be done by running git log --author=NAME | tig and then pressing “m” to go to the Main view, or by simply running tig --author=NAME which starts the program in the Main view. The man page tells us that when we run tig without a subcommand, tig accepts all valid git log and git diff options, which is why running tig --author=NAME works.