Last active
September 23, 2022 05:52
-
-
Save Oreoxmt/862f24cec9a5915c71019dea2795c423 to your computer and use it in GitHub Desktop.
Generate a last commit report of a folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
DIR=$1 | |
REPO=$2 | |
FIND=$(which gfind || which find) | |
SED=$(which gsed || which sed) | |
( | |
echo '| File | Last Commit Author | Last Commit Date | Relative Date |' | |
echo '| ---- | ------------------ | ---------------- | ------------- |' | |
( | |
cd "$DIR" | |
$FIND . -name '*.md' | $SED 's~^./~~' | while read -r FILE; do | |
git --no-pager log -1 --format=format:'%at | '"[$FILE](https://github.com/$REPO/blob/%H/$FILE)"' | %an | %as | %ar |%n' "$FILE" | |
done | |
) | sort --numeric-sort | $SED -E 's~^[0-9]+ ~~' | |
) >"$DIR"_commit_log.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment