显示导致冲突的提交的作者和提交消息 [英] Display the Authors and commit message for commits that cause a conflict
问题描述
我有两个长期运行的分支dev
和一个很远的发行版future
.我们通过显示错误的标记进行分支来创建受支持版本的修复程序,对其进行修复,然后打开对这两个分支的请求请求.如果未来"分支中存在冲突,则我们的开发人员应该创建一个新分支,解决冲突,并为将来打开另一个PR.
I have two long-running branches dev
, and a far future release called future
. We create fixes for the supported release by branching from the tag that exhibits the bug, fix it, and then open pull-requests to the two branches. If there is a conflict in the 'future' branch, our developers are suppose to create a new branch, resolve the conflicts, and open another PR to future.
不幸的是,我们的团队足够大,以至于还没有完成很多这样的第二次PR.现在,我需要弄清楚哪些确切的提交导致了冲突.我可以通过在每个冲突的文件上运行git blame并在======
行的每一侧上查看提交来手动完成此操作,但这实际上并不能提供足够的信息,因此我必须为每次冲突手动运行git blame还有每个文件.
Unfortunately, our team is large enough that plenty of these second PRs haven't been made. I need to now figure out which exact commits caused conflicts. I can do this manually by running git blame on each conflicted file, and seeing the commits on each side of the ======
line, but that doesn't actually give me enough information, and I have to manually run git blame for every conflict and every file.
有没有更简单的方法?理想情况下,我想要等同于以下内容的东西:
Is there an easier way? Ideally, I'd want something equivalent to:
Commit X: <coworker1> I updated something.
Commit Y: <coworker2> Something fixed.
Conflicts:
some/file/here
a/different/file.
每个冲突.
尽管任何能提供冲突提交清单的内容都足以确保赏金.
Though anything that just gives me the list of conflicting commits would be useful enough to warrant the bounty.
推荐答案
您可以在合并时运行git diff --diff-filter=U
,以查看所有(仅)未合并文件的差异输出.它仍然具有文件内容,但是比为每个文件手动运行命令要好.
You could run git diff --diff-filter=U
while merging to see diff output for all (and only) unmerged files. It's still with file content, but it's better than manually running a command for each file.
这篇关于显示导致冲突的提交的作者和提交消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!