Fix indentation and add comments
This commit is contained in:
parent
4bc0420b74
commit
cf80c7e5b1
|
@ -14,14 +14,17 @@ REPO="${REPO:-$(pwd)}"
|
||||||
|
|
||||||
mkdir -p ./result
|
mkdir -p ./result
|
||||||
|
|
||||||
|
# Create a unique result file name based on the repository path.
|
||||||
repo_hash="$(echo -n "${REPO}" | md5sum | cut -d ' ' -f1)"
|
repo_hash="$(echo -n "${REPO}" | md5sum | cut -d ' ' -f1)"
|
||||||
result_file="./result/${repo_hash}"
|
result_file="./result/${repo_hash}"
|
||||||
|
|
||||||
echo "Result file: ${result_file}"
|
echo "Result file: ${result_file}"
|
||||||
|
|
||||||
|
# If there is no result file for this repository, parse its commits and create one.
|
||||||
if [[ ! -f "${result_file}" ]]; then
|
if [[ ! -f "${result_file}" ]]; then
|
||||||
for commit_id in $(git -C "${REPO}" rev-list --all --no-merges); do
|
for commit_id in $(git -C "${REPO}" rev-list --all --no-merges); do
|
||||||
echo "Processing commit ${commit_id}..."
|
echo "Processing commit ${commit_id}..."
|
||||||
|
|
||||||
# Calculate the legnth of the commit message.
|
# Calculate the legnth of the commit message.
|
||||||
commit_message=$(GIT_PAGER=cat git -C "${REPO}" show "${commit_id}" -s --format=%B)
|
commit_message=$(GIT_PAGER=cat git -C "${REPO}" show "${commit_id}" -s --format=%B)
|
||||||
commit_message_length=$(echo "${commit_message}" | wc -l)
|
commit_message_length=$(echo "${commit_message}" | wc -l)
|
||||||
|
|
Loading…
Reference in a new issue