feat(functions): add -l/--local flag to mkrep #167

Merged
rootiest merged 2 commits from feat/mkrep-local-flag into main 2026-09-22 07:18:18 +00:00
Owner

Summary

Adds a -l/--local flag to mkrep that enforces strictly local directory creation and repository initialization, overriding and ignoring any flags (--remote, --new-remote, --server, --check-existing, --yes) or environment variables ($GIT_SERVER, $GITEA_URL, $GITEA_HOST, $GITLAB_URL, $GITLAB_HOST, $MKREP_REMOTE_CMD) that would otherwise attempt to link to, create, or check a remote repository.

Even when passed alongside conflicting remote flags like --server gitea or --remote <url>, -l/--local takes precedence and executes local actions without erroring.

Changes

  • Updated functions/mkrep.fish:
    • Added l/local to argparse.
    • Added -l, --local documentation to the function header (SYNOPSIS, DESCRIPTION, ARGUMENTS, EXAMPLE) and to the --help menu.
    • Implemented flag neutralization so that _flag_local clears remote flags and bypasses server resolution.
  • Updated docs/fish-config.md: Regenerated Section 5 manual documentation.
  • Updated tests/test-mkrep.fish: Added comprehensive unit tests covering -l / --local with various remote flags and environment variables.

Manual Verification Checklist

  • Run mkrep -l ~/projects/test-local-repo and verify a local directory and git repository are initialized with no remotes configured (git -C ~/projects/test-local-repo remote).
  • Run mkrep --server gitea -l ~/projects/test-local-gitea and confirm --server is ignored and no forge creation occurs.
  • Run mkrep --remote https://example.invalid/repo.git -l ~/projects/test-local-remote and confirm origin is not added.
  • Run mkrep --help and verify -l, --local appears in the Flags list.
  • Run fish tests/test-mkrep.fish and verify all 105 tests pass.
### Summary Adds a `-l`/`--local` flag to `mkrep` that enforces strictly local directory creation and repository initialization, overriding and ignoring any flags (`--remote`, `--new-remote`, `--server`, `--check-existing`, `--yes`) or environment variables (`$GIT_SERVER`, `$GITEA_URL`, `$GITEA_HOST`, `$GITLAB_URL`, `$GITLAB_HOST`, `$MKREP_REMOTE_CMD`) that would otherwise attempt to link to, create, or check a remote repository. Even when passed alongside conflicting remote flags like `--server gitea` or `--remote <url>`, `-l`/`--local` takes precedence and executes local actions without erroring. ### Changes - Updated `functions/mkrep.fish`: - Added `l/local` to `argparse`. - Added `-l, --local` documentation to the function header (`SYNOPSIS`, `DESCRIPTION`, `ARGUMENTS`, `EXAMPLE`) and to the `--help` menu. - Implemented flag neutralization so that `_flag_local` clears remote flags and bypasses server resolution. - Updated `docs/fish-config.md`: Regenerated Section 5 manual documentation. - Updated `tests/test-mkrep.fish`: Added comprehensive unit tests covering `-l` / `--local` with various remote flags and environment variables. ### Manual Verification Checklist - [x] Run `mkrep -l ~/projects/test-local-repo` and verify a local directory and git repository are initialized with no remotes configured (`git -C ~/projects/test-local-repo remote`). - [x] Run `mkrep --server gitea -l ~/projects/test-local-gitea` and confirm `--server` is ignored and no forge creation occurs. - [x] Run `mkrep --remote https://example.invalid/repo.git -l ~/projects/test-local-remote` and confirm origin is not added. - [x] Run `mkrep --help` and verify `-l, --local` appears in the Flags list. - [x] Run `fish tests/test-mkrep.fish` and verify all 105 tests pass.
rootiest added the Kind/FeatureArea/FunctionsArea/Docs labels 2026-09-22 06:55:09 +00:00
rootiest added 1 commit 2026-09-22 06:55:11 +00:00
Add -l/--local flag to enforce strictly local repository creation in mkrep, overriding and ignoring any remote flags or environment variables that would link to or create a remote.
gitea-actions bot added 1 commit 2026-09-22 07:14:42 +00:00
rootiest merged commit b10f076105 into main 2026-09-22 07:18:18 +00:00
rootiest deleted branch feat/mkrep-local-flag 2026-09-22 07:18:18 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/fish-config#167