Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can gitk show all commits EXCEPT those by a given author?

I want to use gitk to view all commits except those by a given author. Something like the following:

gitk --author=!joe

Is this possible?

like image 595
David Hansen Avatar asked Jun 13 '11 17:06

David Hansen


People also ask

How do I see commits in a specific file?

Use git log --all <filename> to view the commits influencing <filename> in all branches.

What is the command to view all the commits made by a specific person in git?

The most basic and powerful tool to do this is the git log command. By default, with no arguments, git log lists the commits made in that repository in reverse chronological order; that is, the most recent commits show up first.

How do you see all commits on the branch?

on left hand side of the repository page you will notice an option commits. if you click on it it will display all commits on that branch.

What is GITK command?

Gitk is a graphical repository browser. It was the first of its kind. It can be thought of as a GUI wrapper for git log . It is useful for exploring and visualizing the history of a repository. It's written in tcl/tk which makes it portable across operating systems.


1 Answers

From the command line:

gitk --perl-regexp --author='^(?!joe)'

To exclude commits by several authors:

gitk --perl-regexp --author='^(?!jack|jill)'

Explanation: (?!whatever) is a (perl-style) look-ahead regular expression: it matches a position not followed by whatever. We anchor it to the beginning of the Author field by the "beginning of string" regexp ^.

Or run gitk --perl-regexp and then in the gitk menu, select View -> New View (or Shift+F4 for short) and write ^(?!joe) into the "Author" field.

If you do not want to always have to type gitk --perl-regexp, you can set up git to globally use perl regular expressions by running

git config --global grep.patternType perl

like image 60
Ansa211 Avatar answered Sep 30 '22 01:09

Ansa211