def subtree_diff(path = Dir.pwd)
      raise ArgumentError, "Git 'subtree' command is not available" unless FalkorLib::Git.command? "subtree"
      if FalkorLib.config.git[:subtrees].empty?
        FalkorLib::Git.config_warn(:subtrees)
        return 1
      end
      exit_status = 0
      git_root_dir = rootdir(path)
      Dir.chdir(git_root_dir) do
        FalkorLib.config.git[:subtrees].each do |dir, conf|
          next if conf[:url].nil?
          #url    = conf[:url]
          remote = dir.gsub(/\//, '-')
          branch = (conf[:branch].nil?) ? 'master' : conf[:branch]
          remotes = FalkorLib::Git.remotes
          raise IOError, "The git remote '#{remote}' is not configured" unless remotes.include?( remote )
          raise IOError, "The git subtree directory '#{dir}' does not exists" unless File.directory?( File.join(git_root_dir, dir) )
          info "Git diff on subtree '#{dir}' with remote '#{remote}/#{branch}'"
          exit_status = execute "git diff #{remote}/#{branch} #{FalkorLib::Git.branch?( git_root_dir )}:#{dir}"
        end
      end
      exit_status
    end
def subtree_diff(path = Dir.pwd)
      raise ArgumentError, "Git 'subtree' command is not available" unless FalkorLib::Git.command? "subtree"
      if FalkorLib.config.git[:subtrees].empty?
        FalkorLib::Git.config_warn(:subtrees)
        return 1
      end
      exit_status = 0
      git_root_dir = rootdir(path)
      Dir.chdir(git_root_dir) do
        FalkorLib.config.git[:subtrees].each do |dir, conf|
          next if conf[:url].nil?
          #url    = conf[:url]
          remote = dir.gsub(/\//, '-')
          branch = (conf[:branch].nil?) ? 'master' : conf[:branch]
          remotes = FalkorLib::Git.remotes
          raise IOError, "The git remote '#{remote}' is not configured" unless remotes.include?( remote )
          raise IOError, "The git subtree directory '#{dir}' does not exists" unless File.directory?( File.join(git_root_dir, dir) )
          info "Git diff on subtree '#{dir}' with remote '#{remote}/#{branch}'"
          exit_status = execute "git diff #{remote}/#{branch} #{FalkorLib::Git.branch?( git_root_dir )}:#{dir}"
        end
      end
      exit_status
    end
subtree_init?
 Show difference between local subtree(s) and their remotes"