0

I have a repo I just checked out. It's basically a group of folders where each folder is an example illustrating a technique developing on a specific platform.

However, some of the samples are wildly out of date.

Given a location in a repo is there a way to show the last commit date for each item (file or folder) in the location? So if I have repo foo containing folders bar and bar2 I want to see the last commit date for bar and bar2 taking into account everything under them, but I don't want to list everything under them.

j03m
  • 5,195
  • 4
  • 46
  • 50
  • possible duplicate of [How to get the last commit date for a bunch of files in git?](http://stackoverflow.com/questions/8611486/how-to-get-the-last-commit-date-for-a-bunch-of-files-in-git) – UpAndAdam Apr 17 '14 at 21:34
  • I suppose it would be a dupe if I thought git log could just give me the top level folder/files that I resided in, but I'm not sure I'm aware of a way. The answer in what you're marking as a dupe does a file filter, which is not what I want. I'd accept an answer using git log that does what I want though. – j03m Apr 17 '14 at 21:56

1 Answers1

1

You can get list of files/directories in particular location using find and then run git log -n1 on each of the items. Something like this will print out last commit's hash and date for each file/directory in ./foo:

find ./foo -maxdepth 1 -print0 | xargs -t -n 1 -0 git log -n 1 --pretty=tformat:"%h %ci" | cat
ArtemB
  • 3,496
  • 17
  • 18