简体   繁体   English

git log:排除仅修改某些子文件夹的提交?

[英]git log: exclude commits that only modify certain subfolder?

When writing the release notes for a new version of a project, sometimes it is interesting to distinguish which contributors are developers and which are just translators. 在为新版本的项目编写发行说明时,有时区分哪些贡献者是开发人员,哪些仅仅是翻译者是很有趣的。

For this, in the case of gettext -based projects, one could simply use git log but just taking in account all the subfolders of a project which are not named po . 为此,在基于gettext的项目中,可以简单地使用git log但只需考虑项目中所有命名为po的子文件夹。

I've seen that git log accepts a path argument, but how to achieve the opposite? 我已经看到git log接受path参数,但是如何实现相反的效果呢? Supply a path to be discarded , instead of taken in account? 提供要丢弃的路径,而不是考虑? Thanks 谢谢

您可以排除名为po的文件夹,并按以下方式显示其他文件夹的所有协作者。

git log -- . '!po/*' --no-merges "$@" | grep ^Author: | sed 's/ <.*//; s/^Author: //' | sort | uniq -c | sort -nr

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM