17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/neeto_translate_cli/git_helper.rb', line 17
def self.progressive_fetch
puts "No neeto-translate commits found, fetching depth 50..."
`git fetch --depth=50 2>/dev/null`
result = `git log --grep="[neeto-translate]" --fixed-strings -n 1 --pretty=format:"%H"`.strip
return result unless result.empty?
puts "Still no commits found, fetching depth 100..."
`git fetch --depth=100 2>/dev/null`
result = `git log --grep="[neeto-translate]" --fixed-strings -n 1 --pretty=format:"%H"`.strip
return result unless result.empty?
puts "Still no commits found, fetching depth 500..."
`git fetch --depth=500 2>/dev/null`
result = `git log --grep="[neeto-translate]" --fixed-strings -n 1 --pretty=format:"%H"`.strip
return result unless result.empty?
puts "Still no commits found, fetching full history..."
`git fetch --unshallow 2>/dev/null`
`git log --grep="[neeto-translate]" --fixed-strings -n 1 --pretty=format:"%H"`.strip
end
|