Compare commits

...

2 Commits

Author SHA1 Message Date
01a4b942f8 Merge pull request 'Use second to last commit date for dates, avoiding the move files to subfolder commit' (#4409) from fix-translation-date into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4409
2024-08-28 09:30:53 +00:00
25e6960709
Use second to last commit date for dates, avoiding the move files to subfolder commit
All checks were successful
continuous-integration/drone/pr Build is passing
2024-08-28 11:29:30 +02:00
2 changed files with 18 additions and 4 deletions

View File

@ -3,10 +3,17 @@
# Makes all access/modified file dates in the whole repository match with the file's last git commit date # Makes all access/modified file dates in the whole repository match with the file's last git commit date
# This is important because Make is based on file timestamps, not git commits # This is important because Make is based on file timestamps, not git commits
total=$(git ls-files $(git rev-parse --show-toplevel) | wc -l) total=$(git ls-files "$(git rev-parse --show-toplevel)" | wc -l)
i=1 i=1
for f in $(git ls-files $(git rev-parse --show-toplevel)); do for f in $(git ls-files "$(git rev-parse --show-toplevel)"); do
echo "[${i}/${total}] $f" echo "[${i}/${total}] $f"
touch -a -m --date="@$(git log --pretty="%ct" -1 "$f")" "$f" # TODO the line directly below this is because after moving main website to fsfe.org dir the translation status
# stuff based on dates became a bit useless.
# So we use the second to last commit date for every file.
# after 6 months or so (february 2025) remove the line below with --follow in it, and uncomment the touch underneath it
# TLDR: If after February 2025 remove line directly below this, containign follow and uncomment the touch line below that,
# without a follow. Please also remove this comment then
touch -a -m --date="@$(git log --pretty="%ct" --follow -2 "$f"| tail -n1)" "$f"
# touch -a -m --date="@$(git log --pretty="%ct" -1 "$f")" "$f"
((i++)) ((i++))
done done

View File

@ -92,7 +92,14 @@ statuses="$(
translation_version="-1" translation_version="-1"
fi fi
if [ "${translation_version:-0}" -lt "${original_version:-0}" ]; then if [ "${translation_version:-0}" -lt "${original_version:-0}" ]; then
originaldate=$(git log --pretty="%cd" --date=raw -1 "$base".en."$ext" | cut -d' ' -f1) # TODO the line directly below this is because after moving main website to fsfe.org dir the translation status
# stuff based on dates became a bit useless.
# So we use the second to last commit date for every file.
# after 6 months or so (february 2025) remove the line below with --follow in it, and uncomment the touch underneath it
# TLDR: If after February 2025 remove line directly below this, containign follow and uncomment the touch line below that,
# without a follow. Please also remove this comment then
originaldate=$(git log --follow --pretty="%ct" -2 "$base".en."$ext" | tail -n1)
# originaldate=$(git log --pretty="%ct" -1 "$base".en."$ext")
if [ "$ext" == "xhtml" ]; then if [ "$ext" == "xhtml" ]; then
original_url="https://webpreview.fsfe.org?uri=${base/#\.\/fsfe.org/}.en.html" original_url="https://webpreview.fsfe.org?uri=${base/#\.\/fsfe.org/}.en.html"
translation_url="https://webpreview.fsfe.org?uri=${base/#\.\/fsfe.org/}.$lang_short.html" translation_url="https://webpreview.fsfe.org?uri=${base/#\.\/fsfe.org/}.$lang_short.html"