Skip to content

Instantly share code, notes, and snippets.

@gizmomogwai
Last active Jun 25, 2021
Embed
What would you like to do?
intellij-community
.DS_Store
*.png
#!/bin/bash
# execute in the cloned intellij-community edition git repo https://github.com/JetBrains/intellij-community.git
mkdir temp
filepath=community-resources/src/idea_community_logo.png
for sha in $(git log --format="%H" $filepath); do
git show $sha:$filepath > temp/$sha.file
done
filepath=community-resources/src/idea_community_logo@2x.png
for sha in $(git log --format="%H" $filepath); do
git show $sha:$filepath > temp/$sha.file
done
def git
"git -C intellij-community"
end
task :default do
[
"community-resources/src/idea_community_logo.png",
"community-resources/src/idea_community_logo@2x.png",
].map{|path|
`#{git} log --format="%h@%cd" --date=format:'%Y-%m-%dT%H-%M-%S' #{path}`
.split("\n")
.map{|line|[path, line]}
}.flatten(1).each {|path, line|
sha, date = line.split("@")
puts "#{path}: #{sha} #{date}"
sh "#{git} show #{sha}:#{path} > #{date}.png"
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment