Skip to content

Instantly share code, notes, and snippets.

@fleeto
Created November 14, 2018 23:45
Show Gist options
  • Save fleeto/ae5793ac374c655af266ba55c33ceda4 to your computer and use it in GitHub Desktop.
Save fleeto/ae5793ac374c655af266ba55c33ceda4 to your computer and use it in GitHub Desktop.
How we find updated files in istio.io

Initialization

git pull https://github.com/istio/istio.io.git git.io.master
cd git.io.master
git checkout master

CronJob

Executed everyday.

cd git.io.master
git pull

Last commit of zh

Get the last commit of a file in zh.

$ git log -1 --pretty=format:'%ad' \
--date=iso8601 \
content_zh/blog/2018/hp/index.md

2018-09-17 08:52:23 -0700

Source file of zh

Get the last commit of the source file(en), before the translation.

$ git log -1 --pretty=format:'%H' \
    --before "2018-09-17 08:52:23 -0700" \
    content/blog/2018/hp/index.md

0a4264417f565e7a2c1d11cbc23508dfdb3a00a7

That commit is the source of the latest version of content_zh/blog/2018/hp/index.md


Diff

$ git diff HEAD \
    0a4264417f565e7a2c1d11cbc23508dfdb3a00a7 \
    content_zh/blog/2018/hp/index.md

If the file had been updated, there will be something, create issue with it.


Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment