1

To check that copyright history is right in files, it would be useful to get the information out of Git without needing to work through every commit for a file. For example

git log --follow -p <file-name>

will show the history but I need to check every commit to see which year it fell in. I can speed things up a bit by checking for commits from one year, but that's still awkward.

What I'd like out really is 'File was changed in 2011-2015,2017,2018,2020' or similar, but failing that a simply list of the commit dates with no other data

2020-02-02
2020-02-02
2018-06-06
2017-01-03
2015-04-04
...

would at least be easy to scan.

Joseph Wright
  • 2,857
  • 22
  • 32

1 Answers1

2

failing that a simply list of the commit dates with no other data

You should be able to add a simple date format to your git log command, using pretty format:

--date=format:'%Y-%m-%d' ---pretty=format:'%ad'
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250