Skip to content

Instantly share code, notes, and snippets.

@ehsahil
Created August 9, 2018 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehsahil/0455d872b24164574a3eb162dc78c062 to your computer and use it in GitHub Desktop.
Save ehsahil/0455d872b24164574a3eb162dc78c062 to your computer and use it in GitHub Desktop.
require 'socket'
require 'colorize'
begin
file = File.open(ARGV[0], "r")
rescue
puts "Usage: ruby git.rb objectsid"
exit
end
file.each_line do |objects|
puts
puts "Content of ObjectID --> #{objects}"
puts "+------------------------------------------------------------------------------------+"
puts
system("git cat-file -p #{objects}")
puts "Moving to next ObjectID"
puts
puts "+------------------------------------------------------------------------------------+"
puts
puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment