Repository: neovim/neovim
File: runtime/lua/vim/health/health.lua (Lua)

Code before:
    'TERM_PROGRAM',
    'COLORTERM',
    'SSH_TTY',
  }) do
    if vim.env[env_var] then
      health.info(string.format('$%s="%s"', env_var, vim.env[env_var]))
    end
  end
end

local function check_external_tools()
  health.start('External Tools')

  if vim.fn.executable('rg') == 1 then
    local rg_path = vim.fn.exepath('rg')
    local rg_job = vim.system({ rg_path, '-V' }):wait()
    if rg_job.code == 0 then
      health.ok(('%s (%s)'):format(vim.trim(rg_job.stdout), rg_path))
    else
      health.warn('found `rg` but failed to run `rg -V`', { rg_job.stderr })
    end
  else
    health.warn('ripgrep not available')
  end

  -- `vim.pack` requires `git` executable with version at least 2.36
  if vim.fn.executable('git') == 1 then
    local git = vim.fn.exepath('git')
    local version = vim.system({ 'git', 'version' }, {}):wait().stdout or ''
    health.ok(('%s (%s)'):format(vim.trim(version), git))
  else
    health.warn('git not available (required by `vim.pack`)')
  end

  if vim.fn.executable('curl') == 1 then
    local curl_path = vim.fn.exepath('curl')
    local curl_job = vim.system({ curl_path, '--version' }):wait()

    if curl_job.code == 0 then
      local curl_out = curl_job.stdout
      if not curl_out or curl_out == '' then
        health.warn(
          string.format('`%s --version` produced no output', curl_path),
          { curl_job.stderr }
        )
        return
      end
      local curl_version = vim.version.parse(curl_out)
      if not curl_version then
        health.warn('Unable to parse curl version from `curl --version`')
        return

Review comment (suggestion):
```suggestion
  -- `vim.pack` prefers git 2.36 but tries to work with 2.x.
```

Code after:
    'TERM_PROGRAM',
    'COLORTERM',
    'SSH_TTY',
  }) do
    if vim.env[env_var] then
      health.info(string.format('$%s="%s"', env_var, vim.env[env_var]))
    end
  end
end

local function check_external_tools()
  health.start('External Tools')

  if vim.fn.executable('rg') == 1 then
    local rg_path = vim.fn.exepath('rg')
    local rg_job = vim.system({ rg_path, '-V' }):wait()
    if rg_job.code == 0 then
      health.ok(('%s (%s)'):format(vim.trim(rg_job.stdout), rg_path))
    else
      health.warn('found `rg` but failed to run `rg -V`', { rg_job.stderr })
    end
  else
    health.warn('ripgrep not available')
  end

  -- `vim.pack` prefers git 2.36 but tries to work with 2.x.
  if vim.fn.executable('git') == 1 then
    local git = vim.fn.exepath('git')
    local version = vim.system({ 'git', 'version' }, {}):wait().stdout or ''
    health.ok(('%s (%s)'):format(vim.trim(version), git))
  else
    health.warn('git not available (required by `vim.pack`)')
  end

  if vim.fn.executable('curl') == 1 then
    local curl_path = vim.fn.exepath('curl')
    local curl_job = vim.system({ curl_path, '--version' }):wait()

    if curl_job.code == 0 then
      local curl_out = curl_job.stdout
      if not curl_out or curl_out == '' then
        health.warn(
          string.format('`%s --version` produced no output', curl_path),
          { curl_job.stderr }
        )
        return
      end
      local curl_version = vim.version.parse(curl_out)
      if not curl_version then
        health.warn('Unable to parse curl version from `curl --version`')
        return