Skip to content

Conversation

@YuriNachos
Copy link

Summary

  • When git is not installed at all, show a more helpful message instead of suggesting to upgrade git version
  • Adds detection for "executable file not found" / "command not found" errors
  • Shows "Git is not installed. Please install git to use lazygit." instead of "Git version must be at least 2.32.0. Please upgrade your git version."

Changes

  • Added GitNotInstalledError translation key in pkg/i18n/english.go
  • Added isGitNotInstalledError() helper function in pkg/app/app.go
  • Updated validateGitVersion() to check error type and show appropriate message

Motivation

Fixes #5028 - the error message was confusing when git wasn't installed at all

Test manual

# Temporarily rename git to simulate "not installed"
sudo mv /usr/bin/git /usr/bin/git.bak
lazygit
# Expected: "Git is not installed. Please install git to use lazygit."

# Restore git
sudo mv /usr/bin/git.bak /usr/bin/git

Checklist

  • Code compiles (go build)
  • Code formatted with gofumpt
  • Commit message follows conventional commits

When git is not installed at all, show a more helpful message
instead of suggesting to upgrade git version.

Fixes jesseduffield#5028
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minor nit: message when git isn't installed yet isn't entirely correct.

1 participant