Problem
Currently, running gitx -i/--init will initialize a git repository in the current directory without any additional confirmation.
This can be risky if the command is executed from sensitive or unintended locations (e.g. /, $HOME, /tmp), where initializing a repository is usually not desired.
Proposed Solution
Add a safety warning before running git init when the current directory is considered potentially unsafe.
Suggested behavior:
- When
gitx -i/--init is run in a sensitive directory:
- Print a clear warning explaining the risk.
- Ask the user for confirmation (e.g.
Continue? [y/N]:).
- Abort the operation if the user does not explicitly confirm.
- When run in a normal project directory:
- Proceed without any additional prompt.
Notes
- This check would only apply when using the
-i/--init flag.
- The TUI should only open after successful initialization.
- Happy to adjust the scope or behavior based on maintainer feedback.
Problem
Currently, running
gitx -i/--initwill initialize a git repository in the current directory without any additional confirmation.This can be risky if the command is executed from sensitive or unintended locations (e.g.
/,$HOME,/tmp), where initializing a repository is usually not desired.Proposed Solution
Add a safety warning before running
git initwhen the current directory is considered potentially unsafe.Suggested behavior:
gitx -i/--initis run in a sensitive directory:Continue? [y/N]:).Notes
-i/--initflag.