Sha256: cf45cf212a392f5e0d979435f6d68a6ceb4f2d4ababe492520c538f95e1d38b3

Contents?: true

Size: 556 Bytes

Versions: 18

Compression:

Stored size: 556 Bytes

Contents

#!/usr/bin/env ruby

submodule_status = `git submodule status`
updated_submodules = []

submodule_status.each_line do |line|
  # Submodules that are not updated start with a + in the submodule status
  # output.

  if line.match(/^\+/)
    # The second word is the submodule directory.
    updated_submodules << line.split(' ')[1]
  end
end

if updated_submodules.length > 0
  puts 'The following git submodules are out of date:'
  updated_submodules.each do |submodule|
    puts "\t#{submodule}"
  end
  puts
  puts "Suggest: 'git submodule update'."
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
overcommit-0.5.0 bin/hooks/post-merge
overcommit-0.4.1 bin/hooks/post-merge
overcommit-0.4.0 bin/hooks/post-merge
overcommit-0.3.2 bin/hooks/post-merge
overcommit-0.3.1 bin/hooks/post-merge
overcommit-0.3.0 bin/hooks/post-merge
overcommit-0.2.6 bin/hooks/post-merge
overcommit-0.2.5 bin/hooks/post-merge
overcommit-0.2.4 bin/hooks/post-merge
overcommit-0.2.3 bin/hooks/post-merge
overcommit-0.2.2 bin/hooks/post-merge
overcommit-0.2.1 bin/hooks/post-merge
overcommit-0.2.0 bin/hooks/post-merge
overcommit-0.1.11 bin/hooks/post-merge
overcommit-0.1.10 bin/hooks/post-merge
overcommit-0.1.9 bin/hooks/post-merge
overcommit-0.1.8 bin/hooks/post-merge
overcommit-0.1.7 bin/hooks/post-merge