Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

equivalence of: git log --exclude-author?

Tags:

git

At work we have a git repo where the majority of all commits are automated commits by a bot user. There are times when I prefer to view a git log from that repo, but without seeing the auto commits. I guess it could be described as an inverted "git log --author" or a "git log --exclude-author=botuser", if such as option had existed.

Currently I do the following, shortcuted to a bash alias.

git log --format="%H %aE" | grep -v -F botuser@domain | while read hash email; do git log -1 $hash; echo; done | less 

My question is if there is a less hackish solution to what I want to accomplish?

like image 789
andol Avatar asked Jul 31 '11 13:07

andol


People also ask

How do I remove a commit from an author?

What you can do is to create a new branch with the desired start point and then using filter branch do a cherry-pick to the desired commit leaving out the unwanted ones. Then in your new branch you will have all the commits without the ones made by a given author.

What is the difference between author and committer in git?

The author is the person who originally wrote the work, whereas the committer is the person who last applied the work. the author and the core member as the committer.

How do I limit a git log?

The most basic filtering option for git log is to limit the number of commits that are displayed. When you're only interested in the last few commits, this saves you the trouble of viewing all the commits in a page. You can limit git log 's output by including the - option.

What is git log -- Oneline?

Git Log OnelineThe oneline option is used to display the output as one commit per line. It also shows the output in brief like the first seven characters of the commit SHA and the commit message. It will be used as follows: $ git log --oneline.


2 Answers

From https://coderwall.com/p/tzdzwa :

git log --perl-regexp --author='^((?!excluded-author-regex).*)$' 

This worked for me.

If you don't want to specify --perl-regexp every time you can do:

git config --global grep.patternType perl 
like image 167
quodlibetor Avatar answered Sep 29 '22 16:09

quodlibetor


Some other answers reference portions of this, but I had success in my repo using the tactic I saw here

 git log --invert-grep --author=<pattern> 

You can add as many author patterns as needed. In my case, the best pattern was the full email, since it is known to be unique

like image 21
mateor Avatar answered Sep 29 '22 14:09

mateor