0

Are there ways to retrieve information for commits in a given repo/branch generated between: Two tags, Two commits, or any of the combination of those? Also, how would I go about making a tool that would have the repo name, branch name and any of those two other options to push out to a text file?

So far I have been able to get a command from git log, example: git log --since='8/17/2021' --until='8/23/2021' > C:\Temp\Git_Output\log2.txt. This lets me obtain a commit change from dates 8/17/2021 until 8/23/2021 and sends it in a text format to that specified file path.

Is there a way I can do any of the above using a powershell script?

TJunky
  • 27
  • 6
  • `git log --since='8/17/2021' --until='8/23/2021' > C:\Temp\Git_Output\log2.txt` is already a valid powershell script. Do you need help parameterizing it? – Mathias R. Jessen Sep 15 '22 at 15:05
  • Well, I would like to do more than just those two dates. I wanted to see if there was a way to include all of the above? Dates, commits, etc. – TJunky Sep 15 '22 at 15:16
  • @TJunky What's the problem then? The commit range? To get commits between A and B, try the `git log [other options] A..B` range (A and B being any commitish, so tag name, branch name, commit hash, anything that can be dereferenced to a commit). – Romain Valeri Sep 15 '22 at 15:39
  • I think I have some sort of way to find all of the above information using the git log --pretty=format"" command. I believe if I can get the right % command I should be able to retrieve the information for specific information. Test command was git log --pretty=format:"%ai %as %n" > C:\Temp\Git_OutPut\Test3.txt. %ai = author date, ISO 8601-like format, %as = author date, short format. Will I be able to do this to gain all the info from above and differentiate them as well? Or is that possible? – TJunky Sep 15 '22 at 16:00

0 Answers0