2017-02-27 45 views
1

是否有可能獲得已觸及給定目錄下的任何文件的請求列表?我可以在GitHub中獲得與特定文件/目錄路徑相關的所有請求的列表嗎?

有一天,我不得不通過過去幾個月的幾十次pull請求,並收集所有在特定感興趣路徑下觸及任何文件的請求。

我試圖使用GitHub上的文件路徑搜索PR,但它似乎沒有對文件路徑進行索引。進一步探討,我無法真正找到一個解決方案的文件搜索拉請求,這是有點令人驚訝。我最終必須通過各種目錄的提交歷史記錄並收集相關的PR,但這是相當乏味的。

是否有任何支持通過GitHub中的受影響文件來概括PR?也許這是API的能力?

+0

http://stackoverflow.com/a/26870440/4280359 –

回答

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

將向您顯示提交,該更改合併到特定文件的更改中。由於您使用PR來合併文件,因此這可能就足夠了。

如果不是這種情況,但是,您有其他合併提交對不屬於公關的主線,則可能需要使用--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. 
相關問題