Sha256: d604f54bb888adbed7bec9278e5557bec199234cdf3503430f59669f3ce7e0bc

Contents?: true

Size: 370 Bytes

Versions: 5

Compression:

Stored size: 370 Bytes

Contents

#!/usr/bin/env ruby
# coding: utf-8

filename = ARGV[0]

commit = nil
res = 'notfound'

`git log --name-status --oneline`.split(/\n/).each { |line|
  if line =~ /^([0-9a-f]{7})/
    commit = $1
  else
    line.chomp!
    a = line.split(/\s+/)
    if a[1] == filename
      res = commit
    end
  end
}

if ARGV[1] == 'range'
  puts "#{res}^..#{res}"
else
  puts res
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
githelp-0.1.4 exe/githelp-fileadded
githelp-0.1.3 exe/githelp-fileadded
githelp-0.1.2 exe/githelp-fileadded
githelp-0.1.1 exe/githelp-fileadded
githelp-0.1.0 exe/githelp-fileadded