Skip to content

Instantly share code, notes, and snippets.

@JensTimmerman
Forked from yogsototh/gitmtime.rb
Last active October 12, 2020 18:59
Show Gist options
  • Save JensTimmerman/c90685e3cb5fb022f3ffdc91292acec1 to your computer and use it in GitHub Desktop.
Save JensTimmerman/c90685e3cb5fb022f3ffdc91292acec1 to your computer and use it in GitHub Desktop.
def gitmtime
# find file extension
filepath=@item[:content_filename]
str=`git -1 log --format='%ci' -- #{filepath}`
# puts '#############'
# puts "item #{filepath}"
# puts "str #{str}"
# puts '#############'
if str == ""
return @item.mtime
else
return DateTime.parse( str )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment