Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT log command to extract pull request titles

I have a huge repository which has multiple folders inside it. Each of these folders is a separate application. Below is a sample of the repo structure:

myGitRepo/
 A/
 B/
 C/
 .git

I have been trying to use git log to fetch Pull request titles. However I want to filter it for a specific folder i.e "C".

Post using below command I was able to extract Pull request titles based on time:

git --git-dir=.git log --merges --since="Wed Oct 10 07:57:32 UTC 2018"

However when I try to filter these PR titles based on my folder, it doesnt work. I have used below command:

git --git-dir=.git log --merges --since="Wed Oct 10 07:57:32 UTC 2018" -- myGitRepo/A/
like image 615
B.T Anand Avatar asked Oct 28 '25 17:10

B.T Anand


1 Answers

I think the issue here is that git is trying to match the condition that -- <path> needs to be modified towards both parents. If you instruct git to check only towards one of the parents, I think the command could work.

Try the following (using --first-parent):

git --git-dir=.git log --first-parent --merges --since="Wed Oct 10 07:57:32 UTC 2018" -- myGitRepo/A/
like image 103
Alderath Avatar answered Oct 31 '25 07:10

Alderath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!