In github if you open a repository you will see a page showing the latest commit and time of each subdirectory and file.
Can I do this by command line in git?
Thanks answers from Klas Mellbourn and Nevik Rehnel, finally I combined these two versions into mine:
#!/bin/bash
FILES=`ls -A`
MAXLEN=0
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
for f in $FILES; do
str=$(git log -1 --format="%cr [%cn] %s" $f)
printf "%-${MAXLEN}s -- %s\n" "$f" "$str"
done
Outputs:
$ bash view.bash
android_webview -- 4 months ago [boxxx@chromium.org] Disable testCalledForIframeUnsupportedSchemeNavigations
ash -- 4 months ago [osxxxx@chromium.org] Rename _hot_ -> _hover_
cc -- 4 months ago [enxx@chromium.org] cc: Let impl-side painting use smaller tiles
chrome -- 5 weeks ago [Deqing] Set the nacl pipe to non-blocking
tools -- 10 weeks ago [Haxx Hx] Add submodule tools/gyp