gpt4 book ai didi

git - 我可以获得与 GitHub 中特定文件/目录路径相关的所有 pull 请求的列表吗?

转载 作者:行者123 更新时间:2023-12-04 13:04:16 24 4
gpt4 key购买 nike

是否可以获取已触及给定目录下任何文件的 pull 请求列表?

前几天,我不得不浏览过去几个月的数十个 pull 请求,并收集所有涉及特定感兴趣路径下的任何文件的请求。

我尝试使用 GitHub 上的文件路径搜索 PR,但文件路径似乎没有被索引。再仔细看看,我真的找不到在 pull 请求中搜索文件的解决方案,这有点令人惊讶。我最终不得不查看各种目录的提交历史并收集相关的 PR,但这相当乏味。

是否支持通过 GitHub 中的受影响文件汇总 PR?也许这是 API 能够做到的?

最佳答案

git log --merges --first-parent -- <file>

将向您显示 merge 到特定文件更改的提交。由于您使用 PR 来 merge 文件,因此这可能就足够了。

但是,如果情况并非如此,并且您在主线上有其他非 PR 的 merge 提交,您可能需要使用 --author=<pattern> 的组合。 , --committer=<pattern> , 和 --grep=<pattern>进一步过滤输出的标志:
   --author=<pattern>, --committer=<pattern>
Limit the commits output to ones with author/committer header lines that match
the specified pattern (regular expression). With more than one
--author=<pattern>, commits whose author matches any of the given patterns are
chosen (similarly for multiple --committer=<pattern>).

--grep=<pattern>
Limit the commits output to ones with log message that matches the specified
pattern (regular expression). With more than one --grep=<pattern>, commits whose
message matches any of the given patterns are chosen (but see --all-match).

When --show-notes is in effect, the message from the notes is matched as if it
were part of the log message.

关于git - 我可以获得与 GitHub 中特定文件/目录路径相关的所有 pull 请求的列表吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42496939/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com