There's a project we're working on where the majority of commits are added in by a front-end developer. He's editing mainly HTML, CSS, JavaScript files that are not related to the back-end work that I'm helping with. It would be great if I could show the git log
minus commits added by the front-end developer, so I could get a view of commits just related to the backend.
Is there an option I can pass to git log
that would allow me to exclude all commits by an author? I just want to exclude this one developer's commits, I still care about viewing commits from other developers as well.
You can hide, edit, or delete comments on issues, pull requests, and commits.
Git Log Oneline The 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.
You may be wondering what the difference is between author and committer. The author is the person who originally wrote the work, whereas the committer is the person who last applied the work.
You need a Regular expression to match a line that doesn't contain a word? Negative lookahead will do just that, but you have to ask git
to use --perl-regexp
.
git log --author='^(?!krlmlr).*$' --perl-regexp
According to git help log
,
--perl-regexp
... requires libpcre to be compiled in.
Apparently, not all git
s out there have this; for the one shipped with Ubuntu 13.04, this works out of the box.
git rev-list --format='%aN' --all \
| sed 'N;/\nauthorname$/d;s/commit \(.*\)/\n.*/\1/' \
| git log --stdin
and of course substitute whatever heads you want for --all
above.
Edit: list/select/process pipelines like this are bread and butter, it's just how git (like a lot of unix tools) was built.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With