Skip to content

feat: add safety warning#35

Merged
bakayu merged 3 commits intomasterfrom
feat-add-safety-warning
Feb 7, 2026
Merged

feat: add safety warning#35
bakayu merged 3 commits intomasterfrom
feat-add-safety-warning

Conversation

@shatrughantwt
Copy link
Contributor

Fixes #34

What this PR does

This PR adds a safety confirmation step before initializing a git repository using gitx -i/--init.

When the command is run from potentially sensitive locations (such as /, $HOME, or /tmp), the user is warned and asked to explicitly confirm before proceeding. This helps prevent accidental repository initialization in unintended directories.

Behavior

  • gitx

    • Errors out if no git repository exists and suggests using -i/--init.
  • gitx -i/--init

    • Shows a safety warning in sensitive directories and asks for confirmation.
    • Aborts if the user does not confirm.
    • Proceeds with initialization and opens the TUI on confirmation.

Notes

  • The safety check only applies when using the -i/--init flag.
  • No change in behavior for normal project directories.
  • The TUI startup flow remains unchanged and runs only after successful initialization.

Please let me know if you’d like the warning scope or behavior adjusted.

Signed-off-by: shatrughan mishra <shatrughanm485@gmail.com>
@shatrughantwt shatrughantwt requested a review from bakayu February 7, 2026 09:53
@bakayu bakayu added enhancement New feature or request language/go Requires the knowledge of "Go" and removed enhancement New feature or request language/go Requires the knowledge of "Go" labels Feb 7, 2026
shatrughantwt and others added 2 commits February 7, 2026 17:01
Signed-off-by: shatrughan mishra <shatrughanm485@gmail.com>
Signed-off-by: Ayush <mail@ayuch.dev>
@bakayu
Copy link
Member

bakayu commented Feb 7, 2026

great work.

@bakayu bakayu merged commit 65e1aac into master Feb 7, 2026
2 checks passed
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.

feat: add safety warning before initializing a git repository

2 participants