Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cleaner dubious ownership error #3881

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kapparina
Copy link

@Kapparina Kapparina commented Sep 1, 2024

Whilst the above issues expect lazygit to prompt the user to prompt whether it should modify their global Git configuration, I believe it is more pertinent that the user instead inform themselves of what's actually going on.

This PR adds a new known error message covering "dubious ownership". Rather than panicking when Git throws such an error, the below error message will be displayed:

Git detected unsafe/dubious ownership of the repository's root directory

Whilst there is a solution/workaround, please understand the relevant risks and purpose of this warning!

See 'git/git@8959555' for background information on said risks

This error is unrelated to lazygit
For more information, see 'https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory'

Whilst I'm not against contributing to the implementation of the expected behaviour in the aforementioned issues, I think informing users of the risks involved is a necessary starting point.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

- Map dubious ownership error to user-friendly message
- Add i18n entry for UnsafeOrNetworkDirectoryError
- Capture dubious ownership error in repo_paths

Signed-off-by: Kapparina <[email protected]>
@Kapparina Kapparina marked this pull request as ready for review September 1, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant