feat(mkrep): add directory + git-repo scaffolding command #142
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
rootiest (Rootiest)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#142
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Adds
mkrep, extendingmkcd's create-and-cd behavior with git repo init and optional remote handling, in its own file per the one-function-per-file convention.git init— all three on by default, each with a--no-*flag to skip it and a same-named flag to force it back on (--no-wins if both are given).--cleanremoves an existing target directory first;--strictrefuses to proceed if it already exists. The two compose:--cleanruns first, so--clean --stricttogether is not a contradiction.--template <path>/--branch <name>pass straight through togit init --template=/-b(no custom logic — git already does this).--remote <url>links an already-existing remote (git remote add origin <url>).--new-remote[=<cmd>]creates a remote first by running a shell command template in the new repo directory (falls back to$MKREP_REMOTE_CMDwith no value given).{name}and{user}are substituted in the template, so the actual host logic (gh/tea/glab, auth, visibility) stays entirely in the user's own configured command rather than being reimplemented here. Starter templates for GitHub/GitLab/Gitea are in the function's doc header.-v/--verbose,-s/--silent(silent wins), and-h/--help.Two small private helpers (
_mkrep_say,_mkrep_verbose) factor out the silent/verbose output-suppression logic shared across every step.Testing
python3 docs/verify-manual.py: 76/76 passedfish tests/run-tests.fish: 453/453 assertions passed (229/229 files lint clean), including 36 newtests/test-mkrep.fishassertions covering the flag matrix — defaults, each--no-*override,--clean/--strictcomposition, negative-flag precedence, silent mode, remote linking, remote creation via command template (including the env-var fallback), and--help.No README changes needed — function docs are owned by the doc-header SSOT (
docs/manual/), not README's function listing.mkcd's create-and-cd behavior plus git init, remote linking, and optional remote creation via a user-configured command template ($MKREP_REMOTE_CMD, {name}/{user} placeholders).